注册管理组件与COM不使用GAC组件、COM、GAC

2023-09-03 11:35:01 作者:喂你一口甜甜

我想知道是否有可能注册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.

推荐答案

叶氏,使用 regasm.exe / codeBase的键的。当您使用 regasm.exe 没有 / codeBase的只写了assmebly的文件名注册表和所以.NET运行时无法找到它,除非大会是在GAC。随着 / codeBase的将会写入的完整路径和.NET会高兴地发现装配当消费者呼叫的CoCreateInstance()

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