Convert projects to .NET v4.5.2 causes unhandled exception

Bug reports.
User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Convert projects to .NET v4.5.2 causes unhandled exception

Post by Stub » Thu Oct 13, 2016 10:13 am

I've been fiddling with Ranorex v6 for a while now. My project has grown over time and I've upgraded it from v6.0.01 to v6.0.2 and on to the current v6.1.0. FWIW the Ranorex Studio About box notes that the .NET Runtime Version is 4.0.

Reading a few posts on the forum I learned that we can now target .NET v4.5.2. I found this setting in the Properties for one of my projects. On the Compiling tab there is a "Target Framework: .NET Framework 4.0" setting. If I click the Change button I am taken to a "Project Upgrade" tab which lets me select all my solution projects and change the target framework to ".NET Framework 4.5.2". They are all set for Compiler Version "C# 5.0".

As soon as I convert them to .NET v4.5.2 the .EXE that Ranorex Studio produces crashes on startup with an unhandled win32 exception. I've tried rebuilding the solution, cleaning the solution, manually cleaning the solution of all obj/bin directories. Same result every time.

I was a bit horrified at the time but discovered that if I reconvert the projects in my solution back to target ".NET Framework 4.0" then all is well again. Phew!

Just curious to know what I am doing wrong? Might be a bug, might be me, not sure. Any thoughts? Not hugely important.

BTW, when you convert the projects and then go back to the project properties the target framework displayed is the previous .NET framework. You have to go into "Change" and back out again before the Compiling tab updates correctly.

jma
Posts: 107
Joined: Fri Jul 03, 2015 9:18 am

Re: Convert projects to .NET v4.5.2 causes unhandled exception

Post by jma » Fri Oct 14, 2016 11:21 am

Hi Stub,

May I ask if you installed the Microsoft .NET Framework 4.5.2 Developer Pack, which is required to target the .NET Framework 4.5.2?

Furthermore, it would be very helpful if you could post the complete exception message.

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: Convert projects to .NET v4.5.2 causes unhandled exception

Post by Stub » Mon Oct 17, 2016 2:41 pm

I had assumed I'd have enough .NET stuff on my box as I have VS2013 and VS2015 installed. But I tried installing the .NET 4.5.2 Developer Pack anyway. It installed so fast I suspect I already had its stuff on already. It was over practically instantaneously.

It didn't help however, same symptoms when I try to Run a Test Suite from Ranorex Studio.

You get the "...has stopped working" message box from Windows. This then changes to state that "A problem caused the program to stop working correctly." If I press the Debug button rather than Close program the "Visual Studio Just-In-Time Debugger" dialog states "An unhandled win32 exception occurred in [my exe]". But, "The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?"

Now, my Ranorex Studio 6.1 is started in an elevated mode. It shows "(Administrator)" in its caption bar.

Moving on if I click "Yes, debug [my exe]" another dialog states, "A debugger is attached to [my exe] but not configured to debug this unhandled exception. To debug this exception, detach the current debugger.

An unhandled exception was raised from Microsoft .NET Framework v1.0, 1.1. or 2.0, but the current debugger is configured to debug Microsoft.NET Framework v4.0 code. Examine the exception using the SOS tool.
"

As you can see there's not a lot of useful information here.

When I open the Ranorex generated solution in VS2015 I get a lot of "vshosts32.exe has stopped working" errors too, FWIW. They come and go so quickly though.

I can convert the projects in my Ranorex solution back to targeting .NET v4.5.1 or v4.0 and all is well again. It's just v4.5.2 that won't work for some reason.

VS2015 is also happy with the Ranorex solution when it targets .NET v4.5.1 and this has given me a thought as I type this post out. I'm still on VS2015 Update1. Not sure when I'll move to Update3 for work-related reasons. Maybe that's it.

jma
Posts: 107
Joined: Fri Jul 03, 2015 9:18 am

Re: Convert projects to .NET v4.5.2 causes unhandled exception

Post by jma » Wed Oct 19, 2016 4:19 pm

That's indeed strange. I would suggest trying to create a completely new solution and converting this solution to 4.5.2. This will at least show if the issue is specific to the solution or to your test environment.
I assume that there is a general issue with the .NET framework. Which operating system do you currently use?