Build Error When Importing to Visual Studio 2012

Feb 27, 2013 at 2:27 PM
Hi all,

I'm getting the following keyfile errors when I download the source through the svn link and try to build in VS2012 Pro on a Windows 7 64-bit Enterprise edition box:

Cannot import the following key file: StrongNameFile.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_72E5E1171EEDE02D

Cannot import the following key file: StrongNameKey.pfx. The key file may be password protected. To correct this, try to import the certificate again or manually install the certificate to the Strong Name CSP with the following key container name: VS_KEY_C099FEAA7C00A73E

I tried to import these pfx's manually into my key store, but they're password protected. Is there anyway around this? I'd like to be able to build the project myself so I can add better checkbox functionality.

Tony
Feb 27, 2013 at 2:46 PM
I've addressed this by disabling assembly signing while testing/playing around, and signing with my own key when I need something usable.

Wouldn't make sense to distribute the private key, as it defeats the point somewhat.
Feb 28, 2013 at 12:51 PM
Thanks Ian. I was able to build by creating my own pfx files and including them in the project. Unfortunately now when I run any unit test at all it completely crashes visual studio. The message in the event log is below from running Test_Pattern_Replacement(). Is this something you have seen before when you add your own key, or do you think I should log this in the issue tracker?

/**************************************************************/
The description for Event ID 0 from source Application cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Error Handler Exception: System.ServiceModel.CommunicationException: There was an error reading from the pipe: Unrecognized error 109 (0x6d). ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: There was an error reading from the pipe: Unrecognized error 109 (0x6d). ---> System.IO.PipeException: There was an error reading from the pipe: Unrecognized error 109 (0x6d).
at System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
--- End of inner exception stack trace ---
at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)
at System.ServiceModel.Channels.StreamConnection.EndRead()
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext) \r\n at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)

the message resource is present but the message is not found in the string/message table
Feb 28, 2013 at 2:13 PM
Edited Feb 28, 2013 at 2:15 PM
I haven't tried. As I mentioned, I typically disable signing to work on things myself.
Our release builds all go via a build server, so I never needed to sign in VS.


Does this happen if you turn assembly signing off completely?

If not, it's something unrelated.

If so:
What version of .NET are you running?
Have you changed to the same key on the test assembly as well?
Feb 28, 2013 at 2:54 PM
I turned assembly signing off in both the DocX and the UnitTests projects. VS still crashes and the same error is written to the event log. DocX is running in 3.5, UnitTests is running in 4.0. I have a Windows 7, 64-bit Enterprise edition box. When I opened in VS2012 the only thing changed was the Documentation\Documentation.shfbproj file, according to my migration report. All other files were untouched.

I'm wondering if you have access to the MSBuild file on the build server...? Maybe there's something a bit funny in there which needs to be done so the project will build itself non-crashing unit tests, since it looks like signing makes no difference.