Mix of DEBUG and RELEASE in configuration - How to solve?

Ranorex Studio, Spy, Recorder, and Driver.
BCTest
Posts: 127
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Mix of DEBUG and RELEASE in configuration - How to solve?

Post by BCTest » Mon Jun 01, 2015 7:13 am

Hello,

we use a Ranorex solution consisting of many Ranorex projects. While trying to execute the test on a new machine we noticed that two projects in the solution were missing.

Error Message:
The module 'TabStammdatenAktivPruefen' (with ID {6c49d644-5851-4bd5-a525-2bdbbc264cbd}) could not be found. A reason can be that the following assemblies could not be loaded: ..\..\..\..\..\TestModul\Gemeinsam\Fahrzeuge\Fahrzeuge\bin\Debug\Fahrzeuge.exe, ..\..\..\..\..\TestModul\Gemeinsam\Programmverwaltung\Programmverwaltung\bin\Debug\Programmverwaltung.exe.

Now we can reproduce this behavior on the development system too. The same error message occurs then we clean the solution in DEBUG and RELEASE-configuration and start the test in RELEASE-configuration.

How can we check and change the settings for the RELEASE-configuration to use RELEASE-executables in each project, including those two missing projects?

Regards,
Thomas

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by odklizec » Mon Jun 01, 2015 7:42 am

Hi,

How exactly do you build and start the project and all its dependencies? I'm not using external projects so far, but I guess that if you run the build from Ranorex Studio, it does not build dependent projectsl? And if it does, it most probably does not change their configuration to the same as master project? So I think you must first re-build all necessary projects before starting the main one?

In my opinion, the best way would be to use a continuous integration system (like Jenkins, Bamboo, etc.) and build all projects with "/p:Configuration=Release" argument. So the building command line should look like this:
MSBuild.exe yourproject.sln /property:Configuration=Release
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

BCTest
Posts: 127
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by BCTest » Mon Jun 01, 2015 9:03 am

Hi odklizec,

thanks for your quick answer!
To compile our solution we use the command you recommended:
MSBuild.exe Handel.sln /p:Configuration=Release /t:Clean;Build
Using this command compiles one executable file for each project and stores it in the bin\release-folder of the solution - only those two projects mentioned in the error-message are missing. And the error-message says that Ranorex looks for the Debug-version of these projects.

As you can see in the screenshot, we use many Ranorex-projects in this solution.
Solution.png
And we always used the same way to add a project to the solution: Left click on solution in the projects-windows --> Add --> Existing project.

So I agree with you: their configuration should be the same as the solution. Maybe we changed the configuration by accident: But where is this setting, to use Debug-files in the Release-configuration?

Regards,
Thomas.
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by odklizec » Mon Jun 01, 2015 9:52 am

That's weird. I would suggest to examine Compiling settings in Project options.
Go to menu Project >> Project Options and in the appeared dialog select tab Compiling. Eventually, right click the project in question and from the appeared context menu select Properties. Then examine Release settings...
ProjectOptions_Compiling.png
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

BCTest
Posts: 127
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by BCTest » Mon Jun 01, 2015 10:50 am

odklizec wrote:That's weird.
I agree.
I checked the settings you mentioned before and found no clue, why these projects are not compiled in the common way with the common settings. Perhaps these are settings in the project and not in the solution. But how can I edit them?

Regards,
Thomas.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by odklizec » Mon Jun 01, 2015 11:44 am

The above mentioned "Project Options" are "Project" related, not solution related! So basically, you need to examine settings of each problematic project. Eventually, you can examine the *.csproj file, belonging to each of the problematic project. Just go to the project directory and search for projectname.csproj file.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

BCTest
Posts: 127
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by BCTest » Mon Jun 01, 2015 12:08 pm

Sadly I can see no difference between a project with "normal" behavior and a project with "special" behavior: both have the same settings - only the "Project Information"/Folders/Files (Tab "Application") are different.
To increase confusion: We use the same project in more solutions and in the other solutions, the executable will be compiled in release-mode. So this could be an indication this behavior is controlled by project-settings.

Regards,
Thomas.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by odklizec » Mon Jun 01, 2015 12:38 pm

It's hard to say what could be wrong without seeing your solution. I would suggest you to directly contact Ranorex support at [email protected].

One more suggestion though... Have you tried to delete bin/obj dirs and rebuild your solution from scratch?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

BCTest
Posts: 127
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by BCTest » Mon Jun 01, 2015 1:40 pm

Yes, we rebuild the solution. Because of this, we noticed the debug-executables in the release-configuration.
Thanks for your help, I'll give Ranorex a try.

Regards,
Thomas.

Starlord
Posts: 10
Joined: Thu May 14, 2015 4:51 pm

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by Starlord » Mon Jun 01, 2015 3:57 pm

Hi,
I have run across a similar issues but it was in Visual Studio. This my case the issue was related to some corrupted references in Source Control. Anyways I was able to fix the issue by deleting the Debug folder and resetting all of the project build settings to Release; then I did a clean rebuild all.
There seems to be some additional settings you can specify for the build settings as well those are referenced in the discussion below:
http://stackoverflow.com/questions/4744 ... -instead-o
Hope this helps.
Cheers

log
Certified Professional
Certified Professional
Posts: 14
Joined: Tue Mar 24, 2015 6:28 am
Location: Sydney, Australia

Re: Mix of DEBUG and RELEASE in configuration - How to solve?

Post by log » Wed Jun 03, 2015 2:54 am

Hi,

This is just a thought, but have you checked the Build Configuration settings in Ranorex Studio?
  • - Open the Build menu
    - Select 'Edit configurations/platforms'
    Ref:
    01-RanorexStudio-EditBuildConfigurationsMenu.png
    - Select the desired configuration in the 'Solution configuration' combo box (in this case, Release)
    - Check the configurations in use for each project
    Ref:
    02-RanorexStudio-BuildConfigurationEditor.png
They should all be set to Release. If there are any set to Debug, you can change them in the Configuration Editor.

Hope that helps,
Gabriel
You do not have the required permissions to view the files attached to this post.

BCTest
Posts: 127
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Re: Mix of DEBUG and RELEASE in configuration - Solved!

Post by BCTest » Thu Jun 04, 2015 7:08 am

Hello Gabriel,
log wrote:This is just a thought, but have you checked the Build Configuration settings in Ranorex Studio?
I checked the settings, they're alright.

Thanks for your help!

------------

Hello Starlord,

your link helped me to find and solve the problem.
Indeed it was a problem in the project-file of the solution. Although the projects were listed in the project-tree as you can see in my post the reference in the csproj-file was missing. Fortunately these projects are included in another solution too, so I copied the project-reference
<ProjectReference Include="..\..\..\TestModul\Gemeinsam\Fahrzeuge\Fahrzeuge\Fahrzeuge.csproj">
      <Project>{090C533C-FD50-4DE8-A9CE-1550C3231768}</Project>
      <Name>Fahrzeuge</Name>
    </ProjectReference>
into the csproj-file and now it works.
No more mix of Debug and Release.
But I don't know how or why these references were missing, I think I added the projects always in the same behavior to a solution.

Regards,
Thomas