Signing assemblies with a key container
This article is a reference for me since I have to look it up all the time.
Since .NET 1.0 I prefer to sign my assemblies and to use a key container with a AssemblyKeyNameAttribute instead of having to define the path of a key file in each assembly:
[assembly: AssemblyKeyName("myKeyName")]
Starting with .NET 2.0/Visual Studio 2005 this generates the compiler warning CS1699 (or an unnumbered warning for VB.NET). For my projects I always enable "Treat warnings as errors". For C# I can add 1699 to the suppressed warnings in the project settings, but I can't find a way to suppress the warning in the VB.NET project settings.
Instead I have to edit the .vbproj-file with a text editor and add somewhere in the first PropertyGroup element the line
<KeyContainerName>myKeyName</KeyContainerName>
Unfortunately Microsoft didn't add a project setting to use assembly key containers.
Comments
Display comments as Linear | Threaded