Register managed assemblies with COM without using the GAC(在不使用 GAC 的情况下向 COM 注册托管程序集)
问题描述
我想知道是否可以在不向 GAC 注册的情况下向 COM 注册程序集.我们需要使用 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.
推荐答案
是的,使用 regasm.exe 和 /codebase 键.当您使用 regasm.exe 而不使用 /codebase 时,它只会将程序集的文件名写入注册表,因此 .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().
这篇关于在不使用 GAC 的情况下向 COM 注册托管程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在不使用 GAC 的情况下向 COM 注册托管程序集
- C#MongoDB使用Builders查找派生对象 2022-09-04
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
