5

I am trying to install a .dll refrence to use it in my code, but i am having issues using the gacutil. Would anyone be able to help me with the format of this?

I have tried using http://msdn.microsoft.com/en-us/library/ex0ss12c.aspx But i must still be doing something wrong...

the .dll that i am trying to install is Office.dll

Here is what i have tried:

gacutil /i Office.dll "C:\File\path\Office.dll"

It comes up with an error saying:

Unknown option: C:\File\path\Office.dll

Would anyone have any ideas to help me with this?

scapegoat17
  • 5,509
  • 14
  • 55
  • 90
  • Why are you gaking the assembly instead of just putting it in your application's bin folder? – NotMe Oct 10 '13 at 13:46
  • 4
    Don't do that. It is a PIA, it needs to be properly registered. Download the correct version from Microsoft and run its installer. – Hans Passant Oct 10 '13 at 13:49

3 Answers3

11

You don't need the second param

just use :

gacutil /i "C:\File\path\Office.dll"

Royi Namir
  • 144,742
  • 138
  • 468
  • 792
4

You can easily add dll to GAC using Publish class. Add reference to System.EnterpriseServices

System.EnterpriseServices.Internal.Publish publish = new System.EnterpriseServices.Internal.Publish();
publish.GacInstall("dll path");
Kurubaran
  • 8,696
  • 5
  • 43
  • 65
2

Try gacutil /i "C:\File\path\Office.dll". Also please note that assembly must be strongly named to be installed correctly in GAC.

Alex
  • 1,657
  • 1
  • 12
  • 6