There is a well-known problem when unit testing managed C++ code in Visual Studio: unmanaged code calling back into managed can't cross app domains and crashes unit tests, as documented here:http://social.msdn.microsoft.com/Forums/is/vststest/thread/fc7bc074-ff05-407b-b646-d9e5532c6998 and in more details here: http://lambert.geek.nz/2007/05/29/unmanaged-appdomain-callback
Using /noisolation flag is one solution but it works only when running tests outside of Visual Studio, meaning you can't debug your tests in Visual Studio.
For me this is a huge thing. Discovering that even Visual Studio 11 beta doesn't offer anything new here was a major disappointment.
So I turned to NUnit, nunit-x86.exe, version 2.6 to be precise, and started running my test with "Use a single AppDomain for all tests" checked. Disappointingly, NUnit displays message: "An unhandled System.ArgumentException was thrown while executing this test: Cannot pass a GCHandle across AppDomains." After that nunit-x86.exe crashes.
Hope was that, given instructions on how to debug NUnit tests, which can be found on SO, I will be able to both debug and avoid GCHandle AppDomain issue. While that hope is somewhat dashed by the crash (and I didn't even attach the debugger yet) I still hope I must be doing something wrong.
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/nunit-discuss?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to nunit-discuss+unsubscribe@googlegroups.com.
>> >> > > nunit-discuss+unsubscribe@googlegroups.com.
>> >> > > For more options, visit this group at
>> >> > >http://groups.google.com/group/nunit-discuss?hl=en.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "NUnit-Discuss" group.
>> > To post to this group, send email to nunit-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > For more options, visit this group at
>> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nunit-discuss/-/23_SUUhcyr8J.
>
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
> http://groups.google.com/group/nunit-discuss?hl=en.
>> >> > > nunit-discuss+unsubscribe@googlegroups.com.
>> >> > > For more options, visit this group at
>> >> > >http://groups.google.com/group/nunit-discuss?hl=en.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "NUnit-Discuss" group.
>> > To post to this group, send email to nunit-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > nunit-discuss+unsubscribe@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nunit-discuss/-/23_SUUhcyr8J.
>
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to
> nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> > > nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> > > For more options, visit this group at
>> >> >> > >http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups "NUnit-Discuss" group.
>> >> > To post to this group, send email to nunit-...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > For more options, visit this group at
>> >> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "NUnit-Discuss" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/nunit-discuss/-/23_SUUhcyr8J.
>> >
>> > To post to this group, send email to nunit-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> >> >> > > nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> > > For more options, visit this group at
>> >> >> > >http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups "NUnit-Discuss" group.
>> >> > To post to this group, send email to nunit-...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > For more options, visit this group at
>> >> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "NUnit-Discuss" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/nunit-discuss/-/23_SUUhcyr8J.
>> >
>> > To post to this group, send email to nunit-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > For more options, visit this group at
>> > http://groups.google.com/group/nunit-discuss?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nunit-discuss/-/WlX2t5sdVu8J.
>
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to
>> >> >> > > nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> > > For more options, visit this group at
>> >> >> > >http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups "NUnit-Discuss" group.
>> >> > To post to this group, send email to nunit-...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > For more options, visit this group at
>> >> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "NUnit-Discuss" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/nunit-discuss/-/23_SUUhcyr8J.
>> >
>> > To post to this group, send email to nunit-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> >> >> > > nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> > > For more options, visit this group at
>> >> >> > >http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups "NUnit-Discuss" group.
>> >> > To post to this group, send email to nunit-...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > For more options, visit this group at
>> >> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "NUnit-Discuss" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/nunit-discuss/-/23_SUUhcyr8J.
>> >
>> > To post to this group, send email to nunit-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > For more options, visit this group at
>> > http://groups.google.com/group/nunit-discuss?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nunit-discuss/-/WlX2t5sdVu8J.
>
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to
>> >> >> >> > > nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> >> > > For more options, visit this group at
>> >> >> >> > >http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >> >
>> >> >> > --
>> >> >> > You received this message because you are subscribed to the Google
>> >> >> > Groups "NUnit-Discuss" group.
>> >> >> > To post to this group, send email to
>> >> >> > nunit-...@googlegroups.com.
>> >> >> > To unsubscribe from this group, send email to
>> >> >> > nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> > For more options, visit this group at
>> >> >> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >> >
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "NUnit-Discuss" group.
>> >> > To view this discussion on the web visit
>> >> > https://groups.google.com/d/msg/nunit-discuss/-/23_SUUhcyr8J.
>> >> >
>> >> > To post to this group, send email to nunit-...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> >> >> > > nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> >> > > For more options, visit this group at
>> >> >> >> > >http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >> >
>> >> >> > --
>> >> >> > You received this message because you are subscribed to the Google
>> >> >> > Groups "NUnit-Discuss" group.
>> >> >> > To post to this group, send email to
>> >> >> > nunit-...@googlegroups.com.
>> >> >> > To unsubscribe from this group, send email to
>> >> >> > nunit-discuss+unsubscribe@googlegroups.com.
>> >> >> > For more options, visit this group at
>> >> >> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >> >> >
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "NUnit-Discuss" group.
>> >> > To view this discussion on the web visit
>> >> > https://groups.google.com/d/msg/nunit-discuss/-/23_SUUhcyr8J.
>> >> >
>> >> > To post to this group, send email to nunit-...@googlegroups.com.
>> >> > To unsubscribe from this group, send email to
>> >> > For more options, visit this group at
>> >> > http://groups.google.com/group/nunit-discuss?hl=en.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "NUnit-Discuss" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/nunit-discuss/-/WlX2t5sdVu8J.
>> >
>> > To post to this group, send email to nunit-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > For more options, visit this group at
>> > http://groups.google.com/group/nunit-discuss?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nunit-discuss/-/62m02ZuOvjsJ.
>
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to