What path should I pass as an AssemblyPath parameter to the Publish.GacRemove function?

StackOverflow https://stackoverflow.com/questions/45729

  •  09-06-2019
  •  | 
  •  

Question

I want to use the Publish.GacRemove function to remove an assembly from GAC. However, I don't understand what path I should pass as an argument.

Should it be a path to the original DLL (what if I removed it after installing it in the GAC?) or the path to the assembly in the GAC?

UPDATE:

I finally used these API wrappers.

Was it helpful?

Solution

I am using the GacInstall to publish my assemblies, however once installed into the gac, I sometimes delete my ‘temporary’ copy of the assemblies.

And then, if I ever wanted to uninstall the assemblies from the gac I do not have the files at the original path. This is causing a problem since I cannot seem to get the GacRemove method to uninstall the assemblies unless I keep the original files.

Conclusion: Yes, you need to specify the path to the original DLL. (And try to not move/delete it later). If you delete it, try to copy the file from the GAC to your original path and you should be able to uninstall it using GacRemove.

OTHER TIPS

I am not exactly sure about it but I believe GacRemove should do the same thing as gacutil /u. So, it should be the path of your DLL. However it doesn't have to be the same DLL file. Copy of the original should suffice since what counts is the uniqueID of the DLL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top