如何获得DebugBreak/AfxDebugBreak,以在带有Visual Studio .NET/2008和CGI和COM的IIS/Server 2008上工作. [英] HOWTO get DebugBreak/AfxDebugBreak to work on IIS/Server 2008 with Visual Studio .NET/2008 with CGI and COM.

查看:95
本文介绍了如何获得DebugBreak/AfxDebugBreak,以在带有Visual Studio .NET/2008和CGI和COM的IIS/Server 2008上工作.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HOWTO获得DebugBreak/AfxDebugBreak以便在带有Visual Studio .NET/2008,带有CGI和COM的IIS/Server 2008上工作.

HOWTO get DebugBreak/AfxDebugBreak to work on IIS/Server 2008 with Visual Studio .NET/2008 with CGI and COM.

请帮助

在过去的2003/2000/XP中,带有Visual Studio 2005/2003的IIS允许开发人员在IIS服务器上运行的CGI和COM应用程序中使用DebugBreak和AfxDebugBreak.即使将IIS的ASP设置为启用客户端调试[appAllowClientDebugging]",这些设置似乎也不再起作用. = TRUE,并且启用服务器端调试[appAllowDebugging]" = TRUE.尝试使用DebugBreak/AfxDebugBreak似乎导致w3wp.exe为COM对象挂起,而CGI为挂起.尽管将虚拟目录设置为仅对本地"服务器使用匿名身份验证,还是会发生这种情况.拥有用户所有登录特权的GOD帐户,没有任何限制.

In ages past, IIS on 2003/2000/XP with Visual Studio 2005/2003 allowed developers to use DebugBreak and AfxDebugBreak in CGI and COM applications, running of course, on the IIS Server. These no longer seem to work, even with setting the IIS's ASP to "Enable Client-side Debugging [appAllowClientDebugging]" = TRUE and the "Enable Server-side Debugging [appAllowDebugging]" = TRUE. Attempts to use DebugBreak/AfxDebugBreak, seem to cause the w3wp.exe to hang for COM objects, and the CGI to hang. This occurs despite setting a virtual directory to ONLY use anonymous authentication to a "local" GOD account which has privileges to ALL things, without any limitation, which the user is logged in as well.

必须采取什么步骤才能使DebugBReak和AfxDebugBreak正常工作?

What steps must one take to get DebugBReak and AfxDebugBreak to work?

编辑-----

我忘了提及"DebugBreak/AfxDebugBreak"是如何实现的.工作了.他们将要做的是触发IIS以显示一个对话框,询问用户是否要调试应用程序.而且它会让用户选择/选择调试器.这样做的关键重要性在于,使用Visual Studio的用户不必先附加到进程",而是直接附加到附加到进程".第一的.这对于仅在会话级别存在的CGI和COM对象非常重要,可能仅在单个发布时刻存在.

I forgot to mention how the "DebugBreak/AfxDebugBreak" worked. What they would do, is trigger IIS to show a dialog to ask the user if the user wanted to debug the application. And it would let the user pick/choose the debugger. The key importance of this was that the user with Visual Studio, did not have to first "Attach to Process" first. This is very important for CGI and COM objects which will only exist at a session level, maybe only at a single post moment.

推荐答案

Hello,

DebugBreak函数通常会导致断点异常在当前进程中发生.您能否在DebugBreak函数所在的位置发布代码段?因为在某些情况下,例如下面的代码段,DebugBreak()引发的异常不会导致通知窗口弹出:
Hello,

DebugBreak function usually causes a breakpoint exception to occur in the current process. Would you please post a code snippet where the DebugBreak function was located? Because in some scenarios, for example, a code snippet like below, the exception thrown by the DebugBreak() will not cause the notification window pop up:
#include "stdafx.h"
#include <windows.h>

void Foo()
{
	DebugBreak();
}
int _tmain(int argc, _TCHAR* argv[])
{
	__try
	{
		Foo();
	}
	__except(EXCEPTION_EXECUTE_HANDLER)
	{
		printf("In main handler\n");
	}
	return 0;
}

那是因为断点异常已经被包罗万象的异常处理程序捕获了,这使我们没有机会看到"debugger picker"(调试器选择器). window.
解决此问题的简单方法是在Foo()函数中添加结构化异常处理块,例如:

That's because the breakpoint exception has already caught by the catch-all exception handler, leaving us  no chance to see the "debugger picker" window.
As simple way to solve this issue is to add the structured exception handling block in the Foo() function, like:

void Foo()
{
	__try
	{
		printf("In Foo\n");
		DebugBreak();
	}
	__except(UnhandledExceptionFilter(GetExceptionInformation()))
	{
		printf("Exception in Foo handler\n");
	}
}

最好的问候,


这篇关于如何获得DebugBreak/AfxDebugBreak,以在带有Visual Studio .NET/2008和CGI和COM的IIS/Server 2008上工作.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆