Error while building a BizTalk 2006 solution on Visual Studio 2005: The key container name ‘key.snk’ does not exist

  • Sandro Pereira
  • Jan 12, 2013
  • 2 min read

Today, while I was playing with BizTalk Server 2006, yes, I know very old stuff, but sometimes it is needed… and for those who are accustomed to developing BizTalk solutions know that we need to sign the project with a strong name assembly key file before we deploy them… nothing new.

The funniest part came when I tried to build the solution in Visual Studio, and I ended up getting this odd error:

Cryptographic failure while signing assembly ‘Myproject.dll’ — ‘The key container name ‘MyKey.snk’ does not exist’

At first, I thought I had set the path to the key wrong, but I quickly realized that was not the case, and if that was the case, we would have received a different error message:

Cryptographic failure while signing assembly ‘Myproject.dll’ – ‘Error reading key file ‘MyKey.snk’ — The system cannot find the file specified’

📝 One-Minute Brief

When building older BizTalk 2006 solutions in Visual Studio 2005, developers may encounter a cryptographic failure: “The key container name ‘key.snk’ does not exist.” This usually happens because the .snk file path was incorrectly entered into the “Assembly Key Name” field instead of the “Assembly Key File” field. Simply moving the file path to the correct property resolves the build error.

Cause

You have incorrectly defined a strong name key file!

The process to sign the project in Visual Studio 2010 is very different from that in Visual Studio 2005. In 2005, we had 3 properties:

  • Assembly Delay Sign.
  • Assembly Key File.
  • and Assembly Key Name.

And we normally only need to configure the Assembly Key File… however, in my case ,I copied and configured the wrong property without intentio,n which led to me to receive this error message, hehe

assembly sign strong name

Solution

That’s easy, you have to properly configure the property Assembly Key File.

Hehehe… Everyone makes mistakes, hehe, lesson learned.

Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son. 

Thanks for Buying me a coffe
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top