Strong Naming an existing assembly

Now this is one problem that we face when we use a 3rd party DLL, which is not-strongly named & we still want to dump it to GAC.

So, lets see the 5-step solution:

  1. Go to Visual Studio Command Prompt
  2. Generate a Strong Name Key File
    sn -k keyPair.snk 
  3. Obtain MSIL for the assembly
    ildasm Assembly.dll /out:Assembly.il 
     
  4. Rename the original assembly
    ren Assembly.dll Assembly.dll.old 
     
  5. Create a new assembly from MSIL & Key File
    ilasm Assembly.il /dll /key= keyPair.snk 
The new Assembly is a strong-named assembly.
Continue reading » · Rating: · Written on: 09-06-08 · 1 Comment »

VS 2008 : Plugin Pop-up issue

While adding a pop-up to a plugin, designed in VS 2008, one of the commonly faced problem is:

Error 1 The best overloaded method match for ‘EnvDTE80.Commands2.AddNamedCommand2(EnvDTE.AddIn, string, string, string, bool, object, ref System.Array, int, int, EnvDTE80.vsCommandControlType)’ has some invalid arguments C:\Punit Ganshani\Desktop Applications\MyAddin2\MyAddin2\Connect.cs 40 24 MyAddin2
Error 2 Argument ‘7′: cannot convert from ‘ref object[]‘ to ‘ref System.Array’ C:\Punit Ganshani\Desktop Applications\MyAddin2\MyAddin2\Connect.cs 40 140 MyAddin2

Resolution:

Change:
object []contextGUIDS = new object[] { };
to:
System.Array
contextGUIDS = new object[] { };

and it should compile & execute perfectly.

Continue reading » · Rating: · Written on: 09-02-08 · No Comments »