I've run into trouble with Ranorex's support for C# 7. I'm personally no good at C#, so I'm trying to expand my skill set. I created a solution and upgraded it to use CSharp 7. All was fine until I stuck my solution out on GIT and another user grabbed it. He got an error about the language version in the solution.
Turns out the Ranorex installation on his machine only had up to C# 5. I'm also responsible for updating the Ranorex installation packages in our distribution system. The distribution system is supposed to install the included vcredist executable via script. I want to make sure that's working properly and add any additional files necessary so our users can take full advantage of this upgrade.
The extra wrinkle here is that this user is still on Window 7, so maybe there is a conflict there too. I'm on Windows 10 and I also have Visual Studio installed, so I'm not sure where I got the language stuff. When I turn to Google, I get so many results pointing in different directions that I'm spinning in circles.
Is C# 7 included in Microsoft Visual C++ 2017 Redistributable that is packaged in the vcredist executable?
If not, what do I need to add to our distribution package?
Ranorex 9 and C# 7
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Ranorex 9 and C# 7
Doug Vaughan
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Ranorex 9 and C# 7
Hello Douglas,
Thank you for your post.
In order to use C# 7 in your Ranorex project, please download and install Microsoft Build Tools 2017:
Afterwards, you should be able to select C# 7 in your project properties.
Kind Regards,
Stephan
Thank you for your post.
In order to use C# 7 in your Ranorex project, please download and install Microsoft Build Tools 2017:
Afterwards, you should be able to select C# 7 in your project properties.
Kind Regards,
Stephan
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: Ranorex 9 and C# 7
This is exactly what I needed. Thank you!Support Team wrote: ↑Fri Mar 22, 2019 2:00 pmHello Douglas,
Thank you for your post.
In order to use C# 7 in your Ranorex project, please download and install Microsoft Build Tools 2017:
Afterwards, you should be able to select C# 7 in your project properties.
Kind Regards,
Stephan
Doug Vaughan
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: Ranorex 9 and C# 7
So just a follow up to this. Installing MS Build Tools (really Visual Studio Build Tools 2017) does indeed add C# 7 language support. However when setting the .Net Framework to 4.6.2 the compiler throws errors saying it can't find the targeting pack. The 4.6.1 targeting pack can be installed in Visual Studio Build Tools 2017, but you have to download 4.6.2 separately for Windows 7 machines I guess. The 4.6.2 Framework does show up when I run the same installer in Windows 10, but I have Visual Studio installed there too so I didn't draw any concrete conclusions.
What I ended up doing was to install only the .Net Desktop Build Tools workload with ONLY the required components. Then I added the optional .NET Framework 4 – 4.6 development tools component. Then installed the 4.6.2 framework via separate installer.
This allowed us to successfully build the project, but when ran into trouble when we added the ClosedXML NuGet package. We get the following build warning:
What I ended up doing was to install only the .Net Desktop Build Tools workload with ONLY the required components. Then I added the optional .NET Framework 4 – 4.6 development tools component. Then installed the 4.6.2 framework via separate installer.
This allowed us to successfully build the project, but when ran into trouble when we added the ClosedXML NuGet package. We get the following build warning:
Found conflicts between different versions of "DocumentFormat.OpenXml" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. (MSB3277) - C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets:2110,5It's only a warning, so it's not going to stop work. However I'd like to understand why this warning is coming up.
Doug Vaughan
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Ranorex 9 and C# 7
Hi Vaughan.Douglas,
Thank you for the further details.
I'm glad you are able to successfully build your project now.
Kind regards,
Stephan
Thank you for the further details.
I'm glad you are able to successfully build your project now.
This warning appears because the "DocumentFormat.OpenXml.dll" is also needed by Ranorex and therefore, it already exists in the the installation directory.It's only a warning, so it's not going to stop work. However I'd like to understand why this warning is coming up.
Kind regards,
Stephan
- Patrick Hollerbach
- Posts: 29
- Joined: Thu Jan 02, 2014 4:00 pm
- Location: Frankurt, Germany
Re: Ranorex 9 and C# 7
Hi,
I installed the Visual Studio Build Tools 2019 but C# 6 / 7 is not available.
I tried with Visual Studio Build Tools 2015, after installing this c# 6 can be choosed for Ranorex Projects.
It seems that the Visual Studio Build Tools 2017 are not longer available for download
Any hope for support of "Visual Studio Build Tools 2019" by ranorex?
Thanks
Patrick
I installed the Visual Studio Build Tools 2019 but C# 6 / 7 is not available.
I tried with Visual Studio Build Tools 2015, after installing this c# 6 can be choosed for Ranorex Projects.
It seems that the Visual Studio Build Tools 2017 are not longer available for download

Any hope for support of "Visual Studio Build Tools 2019" by ranorex?
Thanks
Patrick
- Patrick Hollerbach
- Posts: 29
- Joined: Thu Jan 02, 2014 4:00 pm
- Location: Frankurt, Germany
Re: Ranorex 9 and C# 7
OK, found it by my self:
https://visualstudio.microsoft.com/de/t ... ls&rel=15#
https://visualstudio.microsoft.com/de/t ... ls&rel=15#
-
- Posts: 68
- Joined: Wed Jun 29, 2016 1:19 pm
- Location: Frankfurt, Germany
- Contact:
Re: Ranorex 9 and C# 7
Hi Patrick. Here are the MS Build Tools 2019Patrick Hollerbach wrote: ↑Thu Oct 17, 2019 4:06 pmOK, found it by my self:
https://visualstudio.microsoft.com/de/t ... ls&rel=15#

https://visualstudio.microsoft.com/than ... ols&rel=16
Ranorex Explorer @DVAG
Support my Ranorex Ideas & Improvements
My current approach: Ranorex 9.2.0
Support my Ranorex Ideas & Improvements
My current approach: Ranorex 9.2.0