Wednesday 5 June 2013

Right way of installing assembly into GAC in Windows Server 2012


In previous version's of Windows Server we were able to simply drag and drop assemblies into GAC folder which wasn't recommended at all, however being in a development environment (Windows Server 2012) when I tried to drag and drop a DLL into GAC, I received this error,




Now if you want to install assembly to GAC following steps,

  1. Assuming you are new to Windows Server 2012, Move your mouse pointer to right bottom of your screen just next to Date & Time.
  2. Click on "Search" tile.
  3. Now enter "cmd" in search text box.
  4. Most likely you will see two apps named as "Command Prompt" and "Visual Studio Command Promp...".
  5. If you will right click on "Visual Studio Command Promp.." it will give you few options at bottom of screen as show in picture below,






  6. Click on "Run as administrator" and press "Yes" for typical dialogue appears each time you try to start       a processes as administrator as security confirmation.
  7. Now type down this command,

    cd C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
  8. Copy your assembly to folder directory,

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC
  9. Once assembly is copied you can use following syntax to install assembly to GAC,

    gacutil /i mySolution.myProject.dll
    an IIS reset will be produced as a result of above command so be careful as if you might break any on going process

That's it. Your assembly is installed, you can follow the procedure as many times as you want.

For more information please check this MSDN link out: http://msdn.microsoft.com/en-us/library/ex0ss12c(v=vs.80).aspx

1 comment:

  1. what if we don't have visual studio installed on the server?

    ReplyDelete