Drag and drop a DLL to the GAC (“assembly”) in windows server 2008 .net 4.0

前端 未结 7 1396
清酒与你
清酒与你 2020-12-01 02:55

I\'ve trying to deploy some code to a client machine, where I don\'t want to install MS windows SDK tools. This means don\'t have access to \"gacutil\". I also have not c

7条回答
  •  一整个雨季
    2020-12-01 03:31

    Keep in mind that the Fusion API is unmanaged. The current reference for it is here: Development Guide > Unmanaged API Reference > Fusion

    However, there is a managed method to add an assembly to GAC: System.EnterpriseServices.Internal.Publish.GacInstall And, if you need to register any Types: System.EnterpriseServices.Internal.Publish.RegisterAssembly

    The reference for the publish class is here: .NET Framework Class Library > System.EnterpriseServices Namespaces > System.EnterpriseServices.Internal

    However, these methods were designed for installing components that are required by a web service application such as ASP.NET or WCF. As a result they don't register the assemblies with Fusion; thus, they can be uninstalled by other applications, or using gacutil and cause your assembly to stop working. So, if you use them outside of a web server where an administrator is managing the GAC then be sure to add a reference to your application in SOFTWARE\Wow6432Node\Microsoft\Fusion\References (for 64-bit OS) or SOFTWARE\Microsoft\Fusion\References (for 32-bit OS) so that nobody can remove your support assemblies unless they uninstall your application.

提交回复
热议问题