I'm working on a SharePoint v3 workflow project using the out-of-the-box (OOB) techniques. In order to install the workflow, you need to know the public key token for the signed assembly that you add to the Global Assembly Cache (GAC). To get this, I have been installling the assembly into the GAC and then looking at the token via the .NET config UI. No fun! Tedious...
So, I wrote some code to grab the key token. It pulls it as a byte array, and I can just convert from there. Here's my code to do the job:
public byte GetToken()
//Uncomment this and comment the statement below it to get a different take on things.
//Here, I am getting the key token for the executing assembly
//AssemblyName myAssembly = AssemblyName.GetAssemblyName(Assembly.GetExecutingAssembly().Location);
//Here, I am getting the key token for a different assembly in the GAC
AssemblyName myAssembly =
byte myKey = myAssembly.GetPublicKeyToken();
Here's the callling code:
Dim c1 As New ClassLibrary1.Class1
Dim b() As Byte
b = c1.GetToken()
Rock Thought for the Day:
I was not sleeping well on Monday (just like Sunday, just like Tuesday, Wednesday, and last night), and I listened to KEXP to pass the time. I heard this fantastic song by Sufjan Stevens, "Pittsfield" from his album, Avalanche. Check it out.