Register managed assemblies with COM without using the GAC

泪湿孤枕 提交于 2019-12-04 14:16:52

问题


I'm wondering if it possible to register assemblies with COM without having to register it with the GAC. We need to deploy some .net libraries that are exposed to classic asp using a CCW. But deployments are a nightmare.


回答1:


Yeap, use regasm.exe with /codebase key for that. When you use regasm.exe without /codebase it only writes the filename of the assmebly to the registry and so the .NET runtime can't find it unless the assembly is in the GAC. With /codebase it will write the full path and .NET will be happy to find the assembly when the consumer calls CoCreateInstance().




回答2:


Yes you can use Regasm on an assembly without it being in the GAC. For example I have mixed ASP and ASP.NET sites with .NET assemblies in the bin folder. Some are exposed to COM and are registered in situ from the bin folder.

Of course these assemblies are unique to the application and aren't shared by other apps. Not to say that isn't possible either, you would probably choose a neutral location to copy such dlls to.



来源:https://stackoverflow.com/questions/1873919/register-managed-assemblies-with-com-without-using-the-gac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!