musefan
musefan

Reputation: 48425

Application no longer runs in release mode after updating to Visual Studio 2015

I have recently installed Visual Studio 2015 (and I still have VS 2012 on my machine).

I opened a solution in VS 2015 and after being prompt that is was incompatible I upgrading the solution and the upgrade log passed with flying colours (no issues).

However, although the solution builds and runs fine in debug mode, it does not work in release mode, it builds successfully but then crashes immediately when running the application.

The following exception message is shown:

An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll

Additional information: Value cannot be null.

And here is a more descriptive image:

enter image description here

As can be seen, "there is no code to show".

I am at a bit of a loss what to look for here to find what the problem is. I have done plenty of searching but seems to be a lot of similar issues, but not this particular one.

So, how do I fix this issue? Or at least what can I do to further investigate the problem and find a solution?

Upvotes: 0

Views: 170

Answers (1)

musefan
musefan

Reputation: 48425

As suggested by Hans Passant in the comments, more information on the exception can be found by enabling the Use Managed Compatibility Mode option under:

Tools > Options > Debugging > General > Use Managed Compatibility Mode

enter image description here

Once enabled, when the application is restarted and the exception is thrown, there is an additional "Actions" option for "View Detail". As you can see from the screenshot in the question, this option was not previously available.

enter image description here

This provides a more detailed stack trace where I was able to identify the exact line of code that was causing the exception. I was then able to identify the cause and resolve my specific issue.

Upvotes: 1

Related Questions