Geeks With Blogs
Colin Bowern ... more of the usual bool

Development machines here use a delayed signing for building binaries. Only during the build process on the build server does a public/private key pair get used for signing assemblies. When using the unit testing features of Visual Studio 2005 we are prompted to provide a key for re-signing an assembly after instrumentation has been applied. If we provide the public key it will fail. If we provide the public/private key pair it will work. 

Has anyone else managed to get this working?  Here's what I'm trying to do:

1. Create a public/private key pair and extract the public key:
sn -k Private.snk
sn -p Private.snk Public.snk
2. Create a class library project and specify it should delay sign using Public.snk
3. Create a test project and enable Code Coverage.
4. Check the "instrument assemblies in place" option and provide a path to the Public.snk
5. Attempt a test run.


From the command prompt:

sn -R bin\Debug\MyAssembly.dll Public.snk

In turn you'll get the following when using IDE for code coverage:

Instrumentation warning: Cannot extract the public key from the key file 'C:\Projects\Common\Common\Public.snk': Bad Version of provider. (Exception from HRESULT: 0x80090007)
Check that the key file is not password protected. Password protected key files are not supported. (It's not password protected!)
Code coverage instrumentation warning while processing file Common.dll:
Warning VSP2001 : C:\Projects\MyAssembly\MyAssembly\bin\Debug\MyAssembly.dll is a strongly named assembly. It will need to be re-signed before it can be executed.
Warning VSP2013 : Instrumenting this image requires it to run as a 32-bit process. The CLR header flags have been updated to reflect this.

When using command prompt:

Failed to extract public key from key pair -- Bad Version of provider.

Ah well.  Filed as a bug and will hopefully be fixed.  So much for the joys of delay signing.

MSDN Product Feedback Center: Bug Details

Posted on Saturday, January 21, 2006 3:13 PM Build and Deployment | Back to top

Comments on this post: Delay Signing defeated! D'oh!

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Colin Bowern | Powered by: