Bruce has a post (which I verbatim here) highlighting one of the small changes in Whidbey which will make life easier for a whole bunch of us.

In Whidbey, the name of the .snk file is included as a property on the project and is picked up my msbuild when compiling.  To get to it:

  • Right-click on the project in the solution explorer and select Properties.
  • Click on the Signing tab.
  • Provide the path to the .snk file.

How is it done today? As Bruce reminds us (and I verbatim here) signing assemblies in VS2003 and earlier meant adding attributes to the AssemblyInfo file, something similar to the following.

[assembly: AssemblyKeyFile("..\\..\\ObjectSharp.snk")]
[assembly: AssemblyDelaySign(false)]

But there are a couple of issues associated with these attributes.  First, the path to the key file is actually embedded in the assembly.  If you use a full path, it is possible that information about your machine (servers and directories, for example) can be easily extracted by using ildasm.  Not overtly dangerous, but not the best situation.

Also, providing a relative path to the key file is annoying.  I’m sure most of you have dealt with the trial and error of finding exactly where the .snk file is relative to the compilation directory.

Finally, because compilation cleanliness is important to all of us, keeping the AssemblyKeyFile attribute in AssemblyInfo generates a warning message.  Not always critical, but annoying.