Install Into Gac Without Gacutil Failure

Active6 years, 2 months ago

I need to install an assembly in GAC using c#. Below is my code:

Consider the following command gacutil /i Microsoft.Powershell.ConsoleHost.dll This will install the assembly to C: Windows Microsoft.NET assembly GAC_MSIL Microsoft.PowerShell.ConsoleHost Now. To get information on the the assembly attributes (Version, Culture, PublicKeyToken), run the gacutil /l command which will return a list of all the assemblies in the GAC. You can also see the information associated with a particular assembly using the -l parameter. I have to install a dll which i build in VC++2005 into GAC but fail to do so. When i run gacutil from command line, it says Failure adding assembly to the cache.

The above code gives the error:

Absolute path required

But i need this to run without using static file path (absolute path). Can anyone tell me whether its possible? I have added the reference to the assembly inside the project references. I need to install this assembly inside GAC.

kaiz.net
1,6543 gold badges22 silver badges31 bronze badges
sharmilasharmila
9683 gold badges18 silver badges36 bronze badges

5 Answers

You could do something like:

or,

Assuming that the file is in your current working directory. If it's not, then you need to define what rules are being used to find this DLL (e.g. is it in the same path as your current executable?)

Damien_The_UnbelieverDamien_The_Unbeliever
202k18 gold badges265 silver badges355 bronze badges

try this below piece I cameup with, let me know if this works

Then use this file path.

If you haven't noticed yet, we have a retro game of the day feature (top-right of the screen) wherein we feature a new retro title every single day! Now, you can vote for your favorite games and allow them to have their moment of glory. Click on the button below to nominate Tomb Raider - Underworld (USA) (En,Fr,Es) for Retro Game of the Day. Tomb Raider Underworld PS2 Iso free download For PCSX2 Pc and mobile,Tomb Raider Underworld apk android ppsspp,Tomb Raider Underworld ps2 iso Sony Playstation 2,For generations, stories have been told of the fearsome weapon of Thor, the Norse god of thunder. Tomb raider underworld ps2 download.

Vignesh.NVignesh.N
1,8512 gold badges19 silver badges29 bronze badges

If you know relative path of that DLL in regard of your executeble, make

Should work for you.

Default
8,6007 gold badges54 silver badges93 bronze badges

Where Is Gacutil

TigranTigran
56.2k6 gold badges71 silver badges108 bronze badges

Error itself states, that you need to give full location path of the dll residing. ie C:myprojectsmyassembly.dll in the path

VIRAVIRA
9501 gold badge11 silver badges24 bronze badges

Install Into Gac Without Gacutil Failure

Simple steps to add a '.dll' file into the Global Assembly Cache in c#:

  1. In your project, 'Add reference' to the .dll file you want to install in the GAC
  2. Form the References, right click on the particular .dll file and select 'Properties'
  3. Change the property 'Copy Local' to 'True'
  4. Build and deploy using wspBuilder
  5. For verification, just check in the manifest file whether the path exists or not and also in 'C:Windowsassembly'.
Simon MᶜKenzie
6,71913 gold badges36 silver badges62 bronze badges

Install Into Gac Without Gacutil Failure Adding Assembly

AbhishekAbhishek

Gacutil Install Windows 10

Not the answer you're looking for? Browse other questions tagged c#.netexception-handlinggac or ask your own question.