string AssemblyPath=string.Empty; System.EnterpriseServices.Internal.Publish Registerhelper = new System.EnterpriseServices.Internal.Publish(); Registerhelper.GacInstall(AssemblyPath);//注册程序集到的全局缓存 Registerhelper.RegisterAssembly(AssemblyPath); //为com注册相互程序集
需要引用System.EnterpriseServices.
这样可以实现Com组件的打包安装