Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The version 2.0.8 throw System.InvalidOperationException with identityServer4 #32

Closed
dyesseyumba opened this issue Sep 19, 2018 · 3 comments

Comments

@dyesseyumba
Copy link

dyesseyumba commented Sep 19, 2018

Hi, I just updated from 2.0.5 to 2.0.8 but when I debug I get this error:

System.InvalidOperationException
  HResult=0x80131509
  Message=No storage mechanism for resources specified. Use the 'AddInMemoryIdentityResources' or 'AddInMemoryApiResources' extension method to register a development version.
  Source=IdentityServer4
  StackTrace:
   at Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.TestService(IServiceProvider serviceProvider, Type service, ILogger logger, String message, Boolean doThrow)
   at Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.Validate(IApplicationBuilder app)
   at Microsoft.AspNetCore.Builder.IdentityServerApplicationBuilderExtensions.UseIdentityServer(IApplicationBuilder app)
   at OemTrack.WebApi.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IServiceProvider serviceFactory) in D:\Repositories\WHO\oem-tracks-backend\src\OemTrack.WebApi\Startup.cs:line 150

The previous version of LightInject.Microsoft.DependencyInjection worked with IdentityServer4 without issues.

I am using
LightInject 5.1.10
LightInject.Microsoft.DependencyInjection 2.0.8
IdentityServer4 2.2.0
netcoreapp2.1

@seesharper
Copy link
Owner

Try adding these options (ContainerOptions)

options.DefaultServiceSelector = serviceNames => serviceNames.SingleOrDefault(string.IsNullOrWhiteSpace) ?? serviceNames.Last();

options.EnablePropertyInjection = false;

@dyesseyumba
Copy link
Author

It worked! Thank you very much.

@seesharper
Copy link
Owner

Great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants