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

Sign the assembly in the nuget package #20

Open
FilipVanBouwel opened this issue Aug 30, 2019 · 5 comments
Open

Sign the assembly in the nuget package #20

FilipVanBouwel opened this issue Aug 30, 2019 · 5 comments

Comments

@FilipVanBouwel
Copy link

It's annoying if we have to add al lthe source code to our project just for the sake of signing it. This makes it so much harder to get the latest version as you would normally do through nuget.

Any chance you can sign the assembly by default?

@Callisto82
Copy link
Owner

Callisto82 commented Aug 31, 2019 via email

@FilipVanBouwel
Copy link
Author

Signing an assembly is pretty straightforward. Just create a Strong Name Key (*.snk) file that contains a public/private key. Put it into your project and on the project properties, signing tab, check 'sign the assembly' and browse to that *.snk file you added to the project.

Steps :

  • open project properties, signing tab.
  • check sign the assembly, choose in the drop down list. Choose a name and password and click ok.
  • a pfx file is added to your project.
  • open visual studio command prompt.
  • create a snk file from the pfx file with this command : sn -p keypair.pfx key.snk (replace keypair with the name you gave your pfx file).
  • add the generated key.snk to your project.
  • in the project properties, signing tab, click and choose the snk file you just added to your project.
  • your assembly will now be signed when you build it.

@olijf
Copy link

olijf commented Jul 6, 2020

@FilipVanBouwel one easy way of consuming unsigned nuget packages is by installing the strongnamer nuget package (https://github.com/dsplaisted/strongnamer). It takes away the hassle of having to find signed nuget packages. As dotnet core is moving away from signed assemblies to fit more into the FOSS mentality/model we can expect in future versions the signing to be omitted completely

@Callisto82
Copy link
Owner

Does the suggestion from @olijf solve your problem then, @FilipVanBouwel?

@FilipVanBouwel
Copy link
Author

Does the suggestion from @olijf solve your problem then, @FilipVanBouwel?

We switched to unsigned assemblies last year when migrating to .NET 6, so my problem kinda went away on its own. :-)

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

3 participants