msbuild

i need to build projects under the same solution. however, msbuild.exe does not support setup project and report project. what i am trying to do is to specify which project needs to be built and which one should be ingored. I guess this should be be configure in xml file, eg. *.build

but how to achieve this

thanks




Re: Visual Studio MSBuild devenv is not an option for me

Simon Dahlbacka

If the solution format would have been MSBuild compatible, you would just have added a Condition="$(BuildingInsideVisualStudio)= true" to the unsupported project types.

However, as the solution format is not msbuild compatible, it is not this simple as msbuild transforms the solution file into a msbuild compatible project file in-memory, and this is automagically performed.

You can however get msbuild to dump the generated file to disk by setting an environment variable MSBuildEmitSolution to 1 and then do the build operation.

It might be possible to manually modify this generated project file and add Condition attributes appropriately, but this is just speculations..

Easier is to build using devenv (which obviously means that Visual studio needs to be installed)






Re: Visual Studio MSBuild devenv is not an option for me

msbuild

thanks Simon

but devenv is not an allowed option to me because we could not guarantee vs studio 2005 on each machine.

cheers








Re: Visual Studio MSBuild devenv is not an option for me

Simon Dahlbacka

so then try my other suggestion..




Re: Visual Studio MSBuild devenv is not an option for me

DanMoseley - MSFT

Hi 'msbuild',

You can invoke MSBuild on the solution once for each project you want, specifying the project name each time. I don't have the syntax handy, but essentially set the environment variable "msbuildemitsolution" to "1" to emit the temporary .sln.proj that MSBuild creates from the .sln. Take a look in there (it's pretty horrible - not intended for human consumption) and you'll see there's targets for each project. You can build the solution specifying a particular project by specifying its target, using the /t switch on msbuild.exe.

We don't advise that people pick up and modify the .sln.proj directly because it's an internal artefact that will change from version to version; also it won't keep in sync with changes to the .sln.

Getting reporting projects and setup projects and solution files and .vcproj to support MSBuild is something we are working on. MSBuild is for certain the Microsoft build platform going forward; it's a matter of convincing the teams that own these files to make converting them a priority over other features. In the meantime, I apologize for the hassle the incompatible formats produce.

Dan