I created a class library project, and I had to sign the dll, so I created a signing key using Visual Studio 2010. I also created a password to protect my key.
After some work on the code, I figured out that, the project assembly name is not good so I renamed the assembly. I continued my work, and it was time to use this dll in an another project; I needed the public key token for the dll; so I used the sn tool to get the public key token:
sn -T <dll name>
I got an error , complaining that the public token for this dll is null. First I thought this is because I did not run the command console with admin privileges; but that was not it. I opened the class library project again, confirmed that sign dll option is checked.; unchecked the option, checked it again; it did not work.
The solution was:
- Uncheck the sign option and delete the key from the project
- Clean the solution
- Generate a new key, with the same password, and check the sign option again
- Compile the project
This worked; apparently if you change the assembly name, after you sign the dll, something gets broken, and Visual Studio can not sign the dll anymore.
Tags: