Sunday, May 31, 2009

Quickly getting the public token key

Scenario:
In Sharepoint every assembly we deploy , need to strongly names. Deploying the assembly to GAC and getting the public token key from them can be length process.

Solution:


Visual Studio External Tools is here for rescue.

1. Open Visual Studio
2. Go to Tools > External Tools > Add a new tool with below settings

Setting 1:

Title : GetPublicTokenKey

Command : C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\sn.exe

Arguments : -T $(TargetPath)

Use Output Window : Checked
OR
Setting 2 ( Need Reflector):
Title : GetPublicTokenKey

Command : C:\Reflector\reflector.exe <-- Change accordingly

Arguments : "$(BinDir)$(TargetName)$(TargetExt)" -debug

Use Output Window : Checked


Now anytime you need to read the public token key , no need to deploy the assembly to GAC .

Just go to Tools >> GetPublicTokenKey and you will get the public token key value in your output window.

0 comments: