Signing assemblies - basics

后端 未结 4 589
忘掉有多难
忘掉有多难 2021-01-31 09:42

What does it mean to sign an assembly? And why is it done?

What is the simplest way to sign it? What is the .snk file for?

4条回答
  •  独厮守ぢ
    2021-01-31 10:21

    It means to give the assembly a unique identity. This is done so there exists a guarantee that an assembly came from a particular source. See the MSDN article Strong-Named Assemblies. A strong-named assembly supports Side by Side Execution, Assembly placement in the GAC, Versioning, and a few other features.

    The simplest way to sign is using the project properties in Visual Studio, the signing tab. This actually adds an XML entry in the .csproj file that tells the build engine to sign the assembly with said key file. The key file is this ".snk" file we are speaking off. It is generated using the sn.exe .NET tool. It contains all information necesary to sign an assembly.

提交回复
热议问题