serilog-web / classic

[Discontinued] Serilog web request logging and enrichment for classic ASP.NET applications
Apache License 2.0
79 stars 32 forks source link

Serilog 2.4.0 doesn't work #40

Closed igorskys closed 7 years ago

igorskys commented 7 years ago

Hello,

I updated my projects with latest serilog. Cleaned packages and after that I started getting Serilog 1.5.0.0 dependency not found exception. Is there workaround for latest version of Serilog?

Thanks!

nblumhardt commented 7 years ago

Thanks for the report. It sounds like the NuGet package install process may not have created the required assembly binding redirects; do the instructions at: https://weblog.west-wind.com/posts/2014/Nov/29/Updating-Assembly-Redirects-with-NuGet help?

igorskys commented 7 years ago

Thanks for the reply. It helped. I was asked to downgrade Serilog to 2.3.0 and for somereason SerilogWeb.Classic returned be to the same issue. The hint doesn't help.

nblumhardt commented 7 years ago

Thanks for the follow-up, good to hear it's working.

igorskys commented 7 years ago

Actually it is not working in my specific case. We have sharepoint application. This application doesn't use app.config, it uses custom config path. I added assembly redirect to my custom config, but it didn't help.

Here is failure log.

=== Pre-bind state information === LOG: DisplayName = Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10 (Fully-specified) LOG: Appbase = file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/ LOG: Initial PrivatePath = C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin Calling assembly : SerilogWeb.Classic, Version=2.1.0.0, Culture=neutral, PublicKeyToken=9462ddd55fbc0e7f. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.config LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Post-policy reference: Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10 LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/16360c98/2517c5fc/Serilog.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/16360c98/2517c5fc/Serilog/Serilog.DLL. LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/bin/Serilog.DLL. WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Thank you!

nblumhardt commented 7 years ago

Thanks for the update.

Serilog 2 has been out for a long time; I'd be happy if we updated this package to depend directly on Serilog 2.5, and bumped its major version.

Is anyone interested in PRing this? Cheers!

igorskys commented 7 years ago

It would be nice to have 👍

jmkelly commented 7 years ago

see https://github.com/serilog-web/classic/pull/42

nblumhardt commented 7 years ago

Closed via #42.

tsimbalar commented 7 years ago

I'm not sure, but I believe there are still traces of older versions of Serilog :-/

I see

<dependencies>
      <dependency id="Serilog" version="1.5.7" />
</dependencies>

in file https://github.com/serilog-web/classic/blob/master/src/SerilogWeb.Classic/SerilogWeb.Classic.nuspec

And the last published NuGet package declares Serilog v1.5.7+ as a dependency : https://www.nuget.org/packages/SerilogWeb.Classic/3.0.19

image

I believe there should be no <dependencies> node in the .nuspec file, as nuget pack projectPath will already generate it for you, looking at the project's packages.config file.