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

Strong Name signature verification is broken for NuGet package versions > 5.0.0 #123

Closed
blakedh opened this issue Dec 8, 2023 · 2 comments
Labels

Comments

@blakedh
Copy link

blakedh commented Dec 8, 2023

Description

I have a .NET Framework 4.8.1 web app utilizing version 5.0.0 of this NuGet package with no issues. However, when I upgrade to any version higher than 5.0.0 (i.e. 7.0.25 or greater) my solution still builds, but the application errors on startup:

Could not load file or assembly 'Serilog.Sinks.AzureTableStorage' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)

When I clone the repo, build locally and reference the project in my solution, it works as expected. Only the published NuGet package causes this error.

The problem appears related to the signing of the assembly during the release/publishing process.

Additional context

A similar bug seems to have affected other Serilog sinks and was fixed by disabling PublicSign by changing this line in the .csproj file:
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
to be:
<PublicSign>false</PublicSign>

For more info about this fix, please see:
serilog-contrib/serilog-sinks-elasticsearch#504
serilog-contrib/serilog-sinks-elasticsearch#498 (comment)

@blakedh blakedh added the bug label Dec 8, 2023
@blakedh
Copy link
Author

blakedh commented Dec 12, 2023

@pwelter34 Working as expected again - excellent, thank you

@deMD
Copy link

deMD commented Oct 23, 2024

Would've been nice if this had been fixed in a v7.0.x release as well. I currently have a project using Umbraco which seems to be hard limited to use Serilog v2,x which isn't supported by v8.x or higher of this package.

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

No branches or pull requests

2 participants