Assembly Signing Changes in VS2005

Just spending the evening playing with Visual Studio 2005 (which says a lot about my life, but that's another story). Actually, because a lot of my most recent has been with COM+, I've been poking and prodding in that area. As a result, I have been (by necessity) signing my assemblies and am happy to report an improvement in VS2005.

As a refresher, 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.

This is no longer necessary in VS2005.  Instead, the name of the .snk file is included as a property on the project.  Simply right-click on the project in the solution explorer and select Properties.  Then click on the Signing tab.  The path to the .snk file can be provided right there.  Providing this information updates the project file, which in turn is picked up by msbuild at compile time.