Get PublicKeyToken in Visual Studio 2008
Probelm:
The common way we all get the PublicKeyToken is of the Libarary DLL is to Drag and Drop it to the GAC (c:\windows\assembly) folder , and then right click the DLL.
“So ? Where is the problem ?” , you might ask
Well there are two of them:
- if you’re in Vista , you just might come across a “privileges” problem, which means: you are part of the Administrator Group but you still can’t drag and drop to the Assembly, is there a workaround to get the PublicKeyToken ?
- If this is “just a step / stage” in the global development , you need to remove the DLL from the GAC , else the project will use the GAC version and not the “development” version – which means you don’t really want it in the GAC , you just need the "Token”
Solution:
In the PostBuild Code add the following
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe" -T "$(TargetPath)"