简体   繁体   中英

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. I have created a test harness that has verified the functionality of this dll.

However, when I try to use classic asp to call one of this dll's methods I get a message like the following:

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

Where will the asp page be looking for these dlls? 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.

Do I need to use GAC registration here? 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.

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.

As a general answer, you can use Fusion Log Viewer to determine what paths have been searched by the assembly binder.

See http://msdn.microsoft.com/en-us/library/e74a18c4.aspx for information on this tool.

Fusion Log Viewer will list all the paths probed by the binder. 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。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM