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
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.
