[Snippet] Add/Remove an Assembly to/from the Global Assembly Cache using C#.Net

 


Code snippets to add remove an assembly from GAC - 

Add reference to - System.EnterpriseServices

using System.EnterpriseServices.Internal;


var path = "the absolute path of assembly";

 Publish publish = new Publish();

 publish.GacInstall(path);

 publish.GacRemove(path);

Reference:

https://docs.microsoft.com/en-us/dotnet/framework/app-domains/install-assembly-into-gac#global-assembly-cache-tool

https://docs.microsoft.com/en-us/dotnet/framework/app-domains/how-to-remove-an-assembly-from-the-gac

Comments

Popular posts from this blog

Prevent WPF Global Keyboard Hook from stops working after hitting keys a while C# .NET

Generate ArcGIS Token By URL Request From ArcGIS Portal, Federated Environment , ESRI JS API and Angular snippets

Solution: IntelliJ not recognizing a particular file correctly, instead its stuck as a text file