PFX code certificate not working for private accessor RRS feed

  • Question

  • Hi,

    After adding a private accessor to a code-signed test project I started getting the following error:

    10>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error : Error occured during processing of assembly 'ASSEMBLY TO BE TESTED': Unable to obtain public key for StrongNameKeyPair.

    The codesign certificate has been obtained as a .CER from our corporate certificate server and then processed as follows:

    cert2spc "%CER%" "%SPC%"
    pvk2pfx.exe -pvk "%PVK%" -pi "" -spc "%SPC%" -pfx "%PFX%" -po "%PASSWORD%" -f

    The generated pfx was working fine to code sign the general build. But after I added the private accessor, I started getting the above error.

    Somehow, it seems that the msbuild BuildShadowTask is more restrictive than the task that signs the general build.

    With delay-signing (and cert verification disabled with sn-Vr...) I get something similar to the above:

    22>C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamTest\Microsoft.TeamTest.targets(14,5): error : Bad Version of provider. (Exception from HRESULT: 0x80090007)

    Does BuildShadowTask only work with .snk files? If so, how can I obtain one from the above files? There does not seem to be any way to do this!

    Thank you in advance

    Monday, April 12, 2010 3:37 PM

All replies

  • I am getting the same problem. Both my to be tested and test projects are signed and it was working fine. As soon as I add a private accessor for my test project I get this error?

    This is with VS2010 and I'm not doing anything clever with build servers or anything, just setup the signing in the project properties.

    Edit: Well I just ended up turning off code signing for my test builds and this solved the problem for me.

    Tuesday, June 15, 2010 1:04 PM