Reputation: 2456
I am using ReSharper to run unit tests developed in C#/NUnit. When I unit test a C++/CLI class, all my tests pass, but then the following message box pops up; "Task Runner Application has stopped working". The class I am testing does not have anything unmanaged:
public ref class MyClass
{
public:
MyClass(
array<double>^ rawPrices,
array<DateTime>^ priceDates)
{
// some unmanaged C++ code runs here
}
(snip)
~MyClass()
{
}
private:
int numDays;
array<double>^ Prices;
array<double>^ Discounts;
};
When all tests succeed, the message pops up. However, when I switch to debugging my unit tests, the tests just succeed. The library I am testing is compiled in Release x64 mode.
Does this peculiar behavior indicate that there is something wrong with MyClass?
Upvotes: 2
Views: 1581
Reputation: 2456
The reason for this peculiar behavior was as follows: I had a recursive method calling itself in an infinite loop.
Upvotes: 10
Reputation: 96
This is probably not your answer, but it might be helpful. You can get this same dialog box if you put the following somewhere in your code:
System.Diagnostics.Debugger.Break();
Of course, you would notice this when you run the tests in the debugger! Still, there might be something similar that your code does. The Break() statement causes unmanaged code to be called and if there is no debugger attached, I guess it might cause a Win32 exception which Resharper lets go unhandled.
Upvotes: 1