Create a solutions folder using MSBuild

we have a solution file containing several solution folders : libraries, unit tests, applications ...

With VS2010, we can only create projects for this folder by right-clicking on it and using "build" or "rebuild".

This works great on developer workstations, and we would like to do the same on the continuous integration server that uses MSBuild .

So, can we create a solutions folder with MSBuild?

Or do we need to create a special solution for each folder?

Thanks in advance for your help.

FINAL EDIT : The output of the answers below is that there is no built-in way to do this, but some workarounds:

  • create a dedicated solution only with selected projects,
  • use dedicated csproj , which will create the selected projects,
  • Add a new project that will reference the selected projects in the existing solution file.

I decided to use a dedicated solution file because it is less intrusive and tricky, although not more flexible (a dedicated csproj solution should offer full control).

+6
source share
2 answers

Short answer:

Yes , if you want to create a specific set of projects (grouped into a VS solution) with a simple MSBuild , you will need to create a dedicated MSBuild.proj for each specific set of projects that you want to build.

You do not have to create (and maintain) VS solutions to support your assembly, but in the end it is one and the same (MSBuild.proj vs. VS solution).

I have a similar scenario with a set of 60+ .NET projects (.btprpj BizTalk). For development in VS, these projects are currently organized in 12 VS solutions.

To build and deploy automatically, I created a set of 50+ MSBuild.proj scripts to target each individual component (or set of components) that I need.

MSBuild offers many possibilities for automating all the material around the actual assembly of VS projects (export from VCS, etc.).

+2
source

Yes, you can create solution folders using MSBUILD

msbuild "framework.sln" /t:First\Project:Build 

There will be an assembly of the project in a folder named First, HOWEVER folders with folders and folders soltions should match (I tried this for my solution, where they are not the first)

So, all you have to do is select a project in which all other projects are in this folder as dependencies.

Also see: http://msdn.microsoft.com/en-us/library/ms164311.aspx

+4
source

Source: https://habr.com/ru/post/889859/


All Articles