如何在经典asp中访问.Net dll? [英] How to access .Net dll in classic asp?
问题描述
我知道这是一个重复的问题,但没有解决方案对我有用.我有一个自定义的 .Net dll.我必须在 aspx 和 asp 页面中使用它.
I know this is a repeated question ,but no solution worked for me . I am having a custom .Net dll . I have to use this in both aspx and asp pages.
在访问 asp 之前,我做了以下事情,
Before accesing in asp ,i did the following things,
1.构建dll项目.
2.在 VS2005 cmd 提示符下,我运行 sn -k MarkItUp.snk.
2.In VS2005 cmd prompt i ran sn -k MarkItUp.snk.
3.将assembly.cs中的key文件引用为[assembly: AssemblyKeyFileAttribute(@"C:ProjectsXxx.xx.UtilitiesinDebugMarkItUp.snk")]
3.Referenced the key file in assembly.cs as [assembly: AssemblyKeyFileAttribute(@"C:ProjectsXxx.xx.UtilitiesinDebugMarkItUp.snk")]
4.然后在VS2005 cmd提示符下
4.Then in VS2005 cmd prompt
1.tlbexp Xxx.xx.Utilities.dll /out:Xxx.xx.Utilities.tlb
2.regasm /tlb:Xxx.xx.Utilities.tlb Xxx.xx.Utilities.dll
3.gacutil /i Xxx.xx.Utilities.dll
一切顺利
5.然后我引用了项目中的dll
5.Then i referenced the dll in the project
6.在我通过 VBScript 的 ASP 页面中,我将 dll 启动为
6.In my ASP page through VBScript i initiated the dll as
Dim strLogger
response.Write("Testing asp")
set strLogger=Server.CreateObject("Xxx.xx.Utilities")
出现如下错误
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
我没有做 regsvr,因为它给了我未找到 DLLRegisterServer 的入口点"错误
任何输入都会帮助我...
Any inputs will be help me...
谢谢,
推荐答案
确保在项目属性中勾选了Make assembly COM visible"
反复试验似乎是当务之急.当 Microsoft 将访问权限默认设置为严格时,COM 和 ASP 变得更加困难.
Trial and error seems to be the order of the day. COM and ASP got a lot harder when Microsoft set access permissions to be strict by default.
这篇关于如何在经典asp中访问.Net dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!