向 COM 注册托管程序集而不使用 GAC

发布于 2024-08-13 13:53:01 字数 82 浏览 2 评论 0原文

我想知道是否可以向 COM 注册程序集,而不必向 GAC 注册。我们需要部署一些使用 CCW 向经典 asp 公开的 .net 库。但部署是一场噩梦。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

隐诗 2024-08-20 13:53:01

是的,使用 regasm.exe/codebase 键即可。当您在没有 /codebase 的情况下使用 regasm.exe 时,它只会将程序集的文件名写入注册表,因此 .NET 运行时无法找到它,除非程序集位于GAC。使用 /codebase 它将写入完整路径,并且当使用者调用 CoCreateInstance() 时,.NET 将很乐意找到程序集。

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().

本王不退位尔等都是臣 2024-08-20 13:53:01

是的,您可以在程序集上使用 Regasm,而无需将其添加到 GAC 中。例如,我将 ASP 和 ASP.NET 站点与 bin 文件夹中的 .NET 程序集混合在一起。有些暴露给 COM 并从 bin 文件夹中就地注册。

当然,这些程序集对于应用程序来说是唯一的,不会被其他应用程序共享。并不是说这也是不可能的,您可能会选择一个中立位置来将此类 dll 复制到其中。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文