简体   繁体   English

经典的asp如何访问COM-Visible类引用的.NET dll?

[英]How does classic asp access .NET dlls that are referenced by a COM-Visible class?

I have a COM-visible dll "COMInterface.dll" which is deployed into an existing application's folder. 我有一个COM-visible dll“COMInterface.dll”,它被部署到现有应用程序的文件夹中。 I have created a test harness that has verified the functionality of this dll. 我已经创建了一个测试工具,它已经验证了这个dll的功能。

However, when I try to use classic asp to call one of this dll's methods I get a message like the following: 但是,当我尝试使用经典的asp来调用这个dll的方法之一时,我得到如下消息:

MyCompany.MyProject.COMInterface (0x80070002) Could not load file or assembly 'MyCompany.Framework, Version=2.6.4202.14897, >Culture=neutral, PublicKeyToken=null' or one of its dependencies. MyCompany.MyProject.COMInterface(0x80070002)无法加载文件或程序集“MyCompany.Framework,Version = 2.6.4202.14897,> Culture = neutral,PublicKeyToken = null”或其依赖项之一。 The system cannot find the file specified. 该系统找不到指定的文件。

My "COMInterface.dll" references a number of other dlls such as my company's standard framework, logging classes etc. "Framework" is one of these such dlls. 我的“COMInterface.dll”引用了许多其他dll,例如我公司的标准框架,日志记录类等。“Framework”就是这些dll之一。

Where will the asp page be looking for these dlls? asp页面在哪里寻找这些dll? I am guessing that my harness worked because it was being run from the program folder whereas the asp page is within an IIS web site. 我猜我的线束工作,因为它是从程序文件夹运行而asp页面是在IIS网站内。

Do I need to use GAC registration here? 我需要在这里使用GAC注册吗? I'm hoping not as there would be quite a few dlls I would need to deploy there and I am hoping to extend the application without having to impact the core installation on users' machines. 我希望不会因为我需要在那里部署很多dll而且我希望扩展应用程序而不必影响用户机器上的核心安装。

Thanks in advance of your questions and suggestions. 在此之前,请提出您的问题和建议。

[EDIT] I should point out that the object can be created fine. [编辑]我应该指出,可以很好地创建对象。 It's the location of the referenced dlls that are causing the problem. 它是导致问题的引用dll的位置。

As a general answer, you can use Fusion Log Viewer to determine what paths have been searched by the assembly binder. 作为一般答案,您可以使用Fusion Log Viewer来确定装配绑定器已搜索的路径。

See http://msdn.microsoft.com/en-us/library/e74a18c4.aspx for information on this tool. 有关此工具的信息,请参见http://msdn.microsoft.com/en-us/library/e74a18c4.aspx

Fusion Log Viewer will list all the paths probed by the binder. Fusion Log Viewer将列出活页夹探测到的所有路径。 If you put your assembly into any of these paths it will be found. 如果您将组件放入任何这些路径中,它将被找到。 Whether any of these paths will be suitable for your scenario I'm not so sure. 无论这些路径中的任何一个是否适合您的场景,我都不太确定。

当您使用Regasm注册dll时,您需要使用/Codebase开关来确保可以找到dll。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使COM可见的.NET程序集发布COM参考 - Make COM-visible .NET assembly release COM reference 如何发布用 C# 创建的 COM-Visible 库 - How to publish a COM-Visible library created with C# 如何解决警告“正在从当前导出的类型或其基本类型之一引用非COM可见值类型”的警告? - How to fix a warning “Non COM-visible value type is being referenced either from the type currently being exported or from one of its base types”? 使 C# Class 库 COM 在 Visual Studio 2022 中可见 - Making C# Class Library COM-Visible in Visual Studio 2022 将带有 COM+ 的经典 ASP 迁移到 Azure Cloud 和 DLL - Migrate classic ASP with COM+ to Azure Cloud and DLLs .NET部署项目不使用但引用的dll需要的dll - .NET deploying dlls that project does not use but referenced dlls require 构建DLL时,COM如何补充.NET Framework? - How does COM complement the .NET Framework when building DLLs? 为 Excel VSTO 插件制作程序集 COM-Visible 中断构建 - Make assembly COM-Visible breaks build for Excel VSTO addin COM应用程序引用的dll故障排除 - COM application referenced dlls troubleshooting 如何在 ASP.Net webapp 中的引用项目 DLL 中初始化 AutoMapper 配置文件 - How to Initialize AutoMapper Profiles in referenced project DLLs in ASP.Net webapp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM