How to resolve project dependencies when using MSBuild

Experiences, small talk, and other automation gossip.
sauer-peters
Posts: 19
Joined: Wed Mar 14, 2012 9:20 am

How to resolve project dependencies when using MSBuild

Post by sauer-peters » Tue Mar 27, 2012 1:31 pm

Hello,
we have a Ranorex solution with three testsuite projects sharing some modules.

- SolutionAB
- - Project A (testsuite using modules of project A, B and C)
- - Project B (testsuite using modules of project B and C)
- - Project C (utilities only used in A and C)

When building this solution in RanorexStudio there is no problem.
But we are also using MSBuild to build the the solution in our CI process. Here we are facing dependecy problems since MSBuild starts with building Project A but needs the assemblies of B and C.
VisualStudio2010 is able to resolve these dependencies and adds them to the solution file. Is something similar also possible for RanorexStudio/SharpDevelop?
At the moment we manually added the dependencies to the ...VS10.sln file and using this for build the testsuite with MSBuild. But every time we are changing the rxsln soultion in RanorexStudio these changes are overwritten.

Do you have any ideas on how to handle these dependencies when using MSBuild?

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: How to resolve project dependencies when using MSBuild

Post by sdaly » Tue Mar 27, 2012 2:23 pm

Hello

We just use a simple build script which cruise kicks off... It copies over some required files and dependencies to the release directory before kicking off msbuild. We commit the latest required Ranorex DLL's to the release folder too which saves us from having to install Ranorex on the cruise box.

XCOPY "..\bin\Debug\Configs" "..\bin\Release\Configs\" /S /Y /D /I
XCOPY "..\bin\Debug\ExternalTools" "..\bin\Release\ExternalTools\" /S /Y/D /I
XCOPY "..\bin\Debug\XMLTestData" "..\bin\Release\XMLTestData\" /S /Y/D /I
XCOPY "C:\Development\GFIAutoFramework\GFIAutoFramework\bin\Debug\GFIAutoFramework.dll" "..\bin\Release\" /S /Y/D /I
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "C:\Development\GFI.Automation\GFI.Automation\GFI.Automation.csproj" /p:Configuration=Release
exit %ERRORLEVEL%

Hope that helps!

sauer-peters
Posts: 19
Joined: Wed Mar 14, 2012 9:20 am

Re: How to resolve project dependencies when using MSBuild

Post by sauer-peters » Thu Sep 13, 2012 10:15 am

Hi there,
Our workaround at the moment is to build the projects separatly in the correct order instead of building the solution.

Meanwhile I think this problem is caused by a bug, or let's say a missing feauture in Ranorex Studio.
Ranorex Studio is obviously able to resolve these project dependencies and builds the projects of the solution in the correct order automatically. But it does not save these information to the ..._VS2010.sln file. It should do so to have the same information available also when opening the test suite solution in MS Visual Studio.

VS2010 is also able to resolve the project dependencies after configuring it again in the related dialog (Build > Project Dependencies). When doing this and saving the solution everything works fine and we are able to build the solution. But after editing the test suite in Ranorex Studio the _VS2010.sln file is overwritten and the relevant changes are gone.

So here is my feature request:
Let Ranorex Studio add the following section to the _VS2010.sln file to be able to build solution in MS Visual Studio right away.

Code: Select all

	ProjectSection(ProjectDependencies) = postProject
		{A36BDF7E-1ED3-4C3F-ACDD-C4EC837ABFB8} = {A36BDF7E-1ED3-4C3F-ACDD-C4EC837ABFB8}
		{0A75BAAA-D855-4E53-AD25-E1ECFF8B5AF7} = {0A75BAAA-D855-4E53-AD25-E1ECFF8B5AF7}
	EndProjectSection
This screnshot of a svn diff shows which sections in the solution file I'm missing:
[img]ProjectDependencies.png[/img]
Attachments
ProjectDependencies.png
ProjectDependencies.png
ProjectDependencies.png (132.33 KiB) Viewed 7664 times