Classic.ASP通过COM调用.NET组件

发布于 2024-08-14 04:58:27 字数 324 浏览 5 评论 0原文

我有一个在 IIS 7(集成模式)中运行的经典 ASP 应用程序,它需要调用正确注册为 COM 的 .NET 库。

一切似乎都可以找到,但即使我在其中放置了几个断点,我也无法调试该库。 VS 调试器似乎没有中断就跨过去了。

这是我的 ASP 代码:

Dim sso: Set sso = Server.CreateObject("SecurityPlatform.ClassicASP_SSO")
sso.Initialize()

我可以单步调试这些行,但似乎不可能单步执行 Initialize()。

有什么线索吗?

I have a Classic-ASP application running in IIS 7 (integrated mode) that needs to call a .NET library that was properly registered as COM.

Everything seems to work find, but I cannot debug the library even if i put several breakpoints in it. The VS debugger seems to step over without breaking.

This is my ASP code:

Dim sso: Set sso = Server.CreateObject("SecurityPlatform.ClassicASP_SSO")
sso.Initialize()

I can step debug those lines, but it seems impossible to step into Initialize().

Any clue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

甜柠檬 2024-08-21 04:58:27

我不确定为什么您不能单步执行,但这里有一个技巧:

在托管代码中调用 System.Diagnostics.Debugger.Break 方法。一旦执行到达此行,就会弹出一个对话框,允许您将 VS 附加到它。

I am not sure why can't you step through but here is one trick:

put a call to System.Diagnostics.Debugger.Break method inside your managed code. Once the execution hits this line a dialog will pop up allowing you to attach VS to it.

眼泪都笑了 2024-08-21 04:58:27

如果这是企业服务/COM+ 组件,您可能需要手动将调试器附加到运行 COM 组件的进程。默认情况下,“进程外”运行的 COM+ 组件不会附加调试器。

上次我这样做时,我们必须附加的进程是最后创建的 dllhost(通常是最高的进程 ID)。您可以通过 Visual Studio 的调试菜单来完成此操作。

If this is an enterprise services/COM+ compoent you might need to manually attach the debugger to the process where the COM component is running. A COM+ component running "out of process" will not have the debugger attached by default.

Last time I did this the process we had to attach to was the last created dllhost (normally highest process id). You can do this via the debug menu of visual studio.

走过海棠暮 2024-08-21 04:58:27

如果您尝试介入通过 COM+ 调用的托管 .NET 代码,请确保将调试器附加到 dllhost.exe 而不是 w3p.exe(或运行 Web 应用程序的任何进程...具体取决于您的IIS 版本)。

COM+ 代码不在 Web 服务器进程中执行...

If you're trying to step in to Managed .NET code being called via COM+, make sure you're attaching the Debugger to dllhost.exe rather than w3p.exe (or whatever process is running your web app...depending on your version of IIS).

COM+ code is not executed in process with the web server...

最舍不得你 2024-08-21 04:58:27

如果您正在单步执行这些行,那么您将已经附加到调试脚本的过程。但是,要调试 .NET 组件中的代码,您需要附加到调试“托管代码”的进程。您无法从脚本单步进入托管组件,因为您无法同时调试脚本和托管代码。

当您附加到 w3wp 进程时,请确保“附加到:”框包含“托管代码”。现在您的断点将正常工作,但您将无法单步执行脚本代码。

If you are stepping those lines then you will already be attached to the process for debugging Script. However to debug the code in the .NET component you need to be attached to the process for debugging "Managed Code". You can't step from script into a managed component because you can't debug Script and Managed Code at the same time.

When you attach to the w3wp process make sure the "Attach To:" box contains "Managed Code". Now your break points will work correctly but you won't be able to step the Script code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文