开发者

Debug assertion does not prompt in IIS 7

since mov开发者_开发百科ing to Windows 7 (IIS 7.5), the debug assertions do not prompt a pop up dialog anymore.

I have tested this in a separate project, and noticed that they do work when using the integrated Visual Studio Developer server (Cassini) but they do not work when using IIS Web Server.

This is a big issue for us since we are counting on debug assertions to identify potential programming errors, so any help would be appreciated. Thanks. Eyal.


That's because failed debug assertions are displayed in the Output window now instead, under the Debug section.

To view the Output window in Visual Studio 2008 go to the 'View' menu and click 'Output'.

I also find it inconvenient. Some more info...


That is the default behavior now and it cannot be changed. What you can is generate a file with the assertions that failed in your app. That will still help you track your issues without halting the app when running inside the IIS.

Take a look at this good article about it.


You can work around by using

System.Diagnostics.Debugger.Launch();

You can make for example this function

[Conditional("DEBUG")]
public static void AssertEx(bool condition, string message)
{
    if (condition) return;

    System.Diagnostics.Debugger.Launch();

    // Still write the message on output
    Debug.Fail(message);
}

and get similar results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜