This is my code:
Register(Assembly.GetExecutingAssembly()).Location);
private void Register(String assemblyName)
{
System.Diagnostics.ProcessStartInfo processStartInfo = new System.Diagnostics.ProcessStartInfo("D://gacutil.exe", string.Format("/i {0}", assemblyName));
processStartInfo.UseShellExecute = false;
System.Diagnostics.Process process= System.Diagnostics.Process.Start(processStartInfo);
process.WaitForExit();
}
How do I add the DLL to the assembly Folder?
MSDN Publish.GacInstall
Use
GacInstall()method in thePublishclass to GAC the assembly easily. Add reference toSystem.EnterpriseServices. Please make sure particular dll is Signed. Only signed assembly can be added to GAC.