Installation Error - Missing key file?

Aug 13, 2008 at 7:43 PM
Hello,

When trying to deploy the TrainingManagement.SiteDefinition project, I get the following error:

Cryptographic failure while signing assembly 'C:\Workspace\SPG\TrainingManagement\TrainingManagement.Common\obj\Debug\TrainingManagement.Common.dll' -- 'Error reading key file 'c:\Workspace\SPG\TrainingManagement\TrainingManagement.snk' -- The system cannot find the file specified. '

I double checked the latest release package and could not find TrainingManagement.snk... Any ideas?

Thank you,

Saul
Developer
Aug 13, 2008 at 9:11 PM
Hi sdolgin. The projects in our solution has to be strong named and installed in the GAC, but we purposefully did not include a snk file. You will need to to use either Visual Studio or the sn tool to create a new snk file and sign your assemblies. We're currently working on a better experience for getting around this issue. We will also update the instructions to include this step. Also, after you have created a new snk file, you will need to update the <SafeAssembly> element in the manifest file of WSP with the correct PublicKeyToken.
Aug 14, 2008 at 5:58 PM
Hello,

Thank you for the quick response.  I took your advice and created a new snk file.  Also I updated the PublicKeyToken in the manifest.xml of the WSP.  This was almost enough to fix the problem. 

After taking your advice the solution was able to build and deploy as expected.  However, when I tried to register for a course as "spgemployee" another exception was displayed... the TrainingManagement.SiteDefinition assembly with PublicKeyToken '9f4da00116c38ec5' could not be found. 

To fix the problem, I did a search through the entire solution for '9f4da00116c38ec5' and replaced each occurrence with my new PublicKeyToken and re-deployed.  Success!

For reference, here are the places in which I found the incorrect PublicKeyToken:

\TrainingManagement.SiteDefinition\pkg\manifest.xml
\TrainingManagement.SiteDefinition\Site Definition\onet.xml
\TrainingManagement.SiteDefinition\Registration Approval\RegistrationApproval.aspx
\TrainingManagement.SiteDefinition\Registration Action\CourseRegistration.aspx

Thanks again,

Saul
Developer
Aug 14, 2008 at 11:13 PM
Thanks for pointing those other files out. We just released a new drop today with an temporary snk file included. You will no longer be required to create your own any more, but you can still choose to create your own if necessary.