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

.NET 4.7 library is in netstandard2.0 folder #86

Closed
MichaelSL opened this issue Jul 19, 2017 · 6 comments
Closed

.NET 4.7 library is in netstandard2.0 folder #86

MichaelSL opened this issue Jul 19, 2017 · 6 comments

Comments

@MichaelSL
Copy link

I'm using the dev build of Serilog.Extensions.Logging and it turned out that .NET 4.7 assembly supplied instead of netstandard 2.0.

image

@nblumhardt
Copy link
Member

That's very strange - here's the CSPROJ: https://github.com/serilog/serilog-extensions-logging/blob/dev/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj#L7

I wonder if it could be a glitch in the viewer, rather than the package? Might need to unzip the NUPKG and dig around.

Is the assembly working correctly?

@MichaelSL
Copy link
Author

The assembly is not working because netstandard uses ILoggerFactory and NET framework uses ILoggingBuilder

I had to add logger manually:
factory.AddProvider((ILoggerProvider) new SerilogLoggerProvider(null, false));

@MichaelSL
Copy link
Author

Target framework is ok when using other viewer (Telerik)
image

but the code is still wrong:
image

@nblumhardt
Copy link
Member

Is it possible you need to update Microsoft.Extensions.Logging? See e.g. #83 (review)

@MichaelSL
Copy link
Author

Indeed the version from NuGet has the ILoggingBuilder. I use the latest Microsoft.AspNetCore.All but I didn't change the signature of Configure method.
ILoggingBuilder is not resolved if I change the signature.

I need to configure logging when building a host in this way:

public static IWebHost BuildWebHost(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>()
                .ConfigureLogging(builder => builder.AddSerilog())
                .Build();

Could you confirm this?

@nblumhardt
Copy link
Member

LGTM, though I'm just wrapping my head around the new APIs, too.

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