IdentityServer / IdentityServer2

[deprecated] Thinktecture IdentityServer is a light-weight security token service built with .NET 4.5, MVC 4, Web API and WCF.
Other
409 stars 291 forks source link

Type Not Found Exception #767

Closed mhdhammod closed 10 years ago

mhdhammod commented 10 years ago

when I am trying to access the "Roles" or "Users" page in the administration page in thinktecture I am getting the following exception :

Type not found for interface: Thinktecture.IdentityServer.Repositories.IUserManagementRepository

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Type not found for interface: Thinktecture.IdentityServer.Repositories.IUserManagementRepository

Line 55: var instance = t.GetConstructor(Type.EmptyTypes).Invoke(null);

Source File: c:\web\idsvr\src\Libraries\Thinktecture.IdentityServer.Core\Repositories\RepositoryExportProvider.cs Line: 55

what is the problem ??

mhdhammod commented 10 years ago

in the stack trace :

[InvalidOperationException: An error occurred when trying to create a controller of type 'Thinktecture.IdentityServer.Web.Areas.Admin.Controllers.RoleController'. Make sure that the controller has a parameterless public constructor.]

there is a parameterless public constructor defined as :

    public RoleController()
    {
        Container.Current.SatisfyImportsOnce(this);
    }
brockallen commented 10 years ago

Have you configured a custom IUserManagementRepository?

mhdhammod commented 10 years ago

this is the code of the main website of thinktecture , it was running very good with no problems , today I opened the site to see this problem , I did not touch the code of the libraries where the exception is happening!

brockallen commented 10 years ago

Look in ~/configuration/repositories.config and see what you have configured for userManagement. That's the class that this is complaining about.

mhdhammod commented 10 years ago

this is the config line : userManagement="Thinktecture.IdentityServer.Repositories.ProviderUserManagementRepository, Thinktecture.IdentityServer.Core.Repositories"

mhdhammod commented 10 years ago

the class ProviderUserManagementRepository is located in namespace Thinktecture.IdentityServer.Core.Repositories and the code inside this file is like the one in the original installation project without any modifications

mhdhammod commented 10 years ago

it worked now! the problem was from ReSharper Extension, it renamed the namespaces for the classes to reflect the current file location. thanks.

brockallen commented 10 years ago

Ah... shame on resharper. :)