I added my little CRM Plugin Tool to the CRM 4.0 Customization 2.0.0.1 release.

The tool can be launched as a standalone exe or as a Visual Studio External Tool (it takes a file path as an optional argument). Use the tool to discover useful information about your Plugin Assemblies (Name, Version, Public Key Token, Culture and the Base 64 encoded string - for the Plugin Content property).

image

The code to do this is ultra simple - using some basic Reflection. It helps to know the right order of the Assembly Properties.

FileInfo fi = new FileInfo(path);
Assembly assembly = Assembly.LoadFile(path);
byte[] bytes = File.ReadAllBytes(path);
string[] assemblyProp = assembly.GetName().FullName.Split(",= ".ToCharArray(),
StringSplitOptions.RemoveEmptyEntries);
textBoxBase64.Text = Convert.ToBase64String(bytes);
textBoxCulture.Text = assemblyProp[4];
textBoxName.Text = assemblyProp[0];
textBoxPublicKeyToken.Text = assemblyProp[6];
textBoxVersion.Text = assemblyProp[2];
textBoxPath.Text = fi.FullName;

 

Enjoy!