If you tried to build a SharePoint solution that has a reference to DLL file that was not signed with strong key, you will get the following error
DLL referenced file not had Strong Key
To set a strong key for a DLL file that you don’t have its source code follow the mentioned steps below:
- Open “Visual Studio Command Prompt” from Start Menu.
- Drop the dll file in a local temp folder in drive C:\ .
- Navigate to your DLL Path file by Typing cd\ to go to the Root C:\
- Type cd then Tap Button to navigate to your specific temp folder .
- Generate the Key file.
sn -k Skey.snk
- Get the MSIL for the assembly.
ildasm Microsoft.ApplicationBlocks.Data.dll /out:Microsoft.ApplicationBlocks.Data.il
- Rename the original assembly, just in case.
ren Microsoft.ApplicationBlocks.Data.dll Microsoft.ApplicationBlocks.Data.dll.orig
- Build a new assembly from the MSIL output and your KeyFile.
ilasm Microsoft.ApplicationBlocks.Data.il /dll /key=Skey.snk
Now the DLL file should be signed with a strong key.
Note: Don't forget to add your signing file in bin folder for SharePoint solution "C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin"