Bad exception interception with the VS 2005 RC debugger

I have an issue with with exception interception with the VS 2005 debugger (the project is .Net library that has been just ported from .Net 1.1 and was running quite fine through the VS 2003 debugger).
Basically, I have a NUnit test that calls a method, and this call (in the unit testing context) is expected to fail by throwing a InvalidOperationException. The NUnit tests actually checks that the exception is thrown.
In my project configuration, I execute the library through the nunit-console.exe application (as a custom start-up program). My problem is that the VS 2005 intercepts the InvalidOperationException although this exception is going to catched properly in the NUnit test.
How can I prevent such behavior of the VS 2005 debugger?
Thanks in advance,
Joannès
[804 byte] By [JoannesVermorel] at [2008-2-7]
# 1
The Visual Studio might think the exception hadn't been handled by user code. You can check Debug/Exceptions... to see whether it has been enabled to stop on user-unhandled exceptions.

You can also try to disable tool/option.../Debugging/Enable Just My code option.

Another possible is there are AppDomain or managed/native boundary between your NUnit test and the library. There is an tool option on the debugging page, which is called "Break when exceptions cross AppDomain or managed/native boundaries". You can try to disable this, if the first solution doesn't work.

Thanks
Lifeng

LifengLuMS at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 2
Yes, your guess is right, the exception is crossing an AppDomain boundary. I understand the utility of debugger feature.
Thanks for the answer,
Joannes
JoannesVermorel at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 3
I also came across this problem in my code. I can't seem to find this option though ("Break when exceptions cross ..."). Can anyone tell me exactly where it is?
alkaline at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...
# 4
Actually, I found out two things:
1. I am using VS .NET 2003. So, does anyone know how where the option is in this version?
2. To test for exceptions in NUnit, you don't use a try-catch block, you set an attribute on the NUnit test:
namespace NUnit.Tests
{
using System;
using NUnit.Framework;

[TestFixture]
public class SuccessTests
{
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void ExpectAnException()
{ /* ... */ }
}
}
}

alkaline at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Debugger...

Visual Studio

Site Classified