Skip to content

Error with Aspnet Core 2.0 #111

Closed
Closed

Description

@tiagorosendo

When i run one API with aspnet core 2.0 and grace i have this error message:

Grace.DependencyInjection.Exceptions.LocateException: 'Could not locate Type System.Func3[System.String,Microsoft.Extensions.Logging.LogLevel,System.Boolean] 1 Importing Microsoft.Extensions.Logging.ILoggerProvider 2 Importing System.Func3[System.String,Microsoft.Extensions.Logging.LogLevel,System.Boolean] for constructor parameter filter
'

Activity

  1. ipjohnson commented on Aug 22, 2017

    @ipjohnson
    Owner

    @tiagorosendo it looks like the constructor for the logging implementation was changed in ASP.Net core to have multiple constructors and Grace as well as other containers are having issues as the longest constructor is being used ...

    I'll take a look this weekend about updating the best matching constructor logic to unroll Func<T,TResult> a little better so it picks the correct constructor in this case.

    For the moment you can probably cheat and register a Func<string,LogLevel,bool> with the container just to get you down the road till I can fix it this weekend.

    Sorry about this I had tested with the DI suite test that MS provides but this behavior isn't specified in the new tests.

  2. added this to the 6.2.3 milestone on Aug 24, 2017
  3. ipjohnson commented on Aug 24, 2017

    @ipjohnson
    Owner

    @tiagorosendo I've tested my changes in a test asp.net core 2.0 app everything looks good so I'm going to close this out and release a nuget package with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions