Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

visual studio 2005 - Does Msbuild recognise any build configurations other than DEBUG|RELEASE

I created a configuration named Test via Visual Studio which currently just takes all of DEBUG settings, however I employ compiler conditions to determine some specific actions if the build happens to be TEST|DEBUG|RELEASE.

However how can I get my MSBUILD script to detect the TEST configuration??

Currently I build

 <MSBuild Projects="@(SolutionsToBuild)" Properties="Configuration=$(Configuration);OutDir=$(BuildDir)Builds" />

Where @(SolutionsToBuild) is a my solution. In the Common MsBuild Project Properties it states that $(Configuration) is a common property but it always appears blank?

Does this mean that it never gets set but is simply reserved for my use or that it can ONLY detect DEBUG|RELEASE. If so what is the point in allowing the creation of different build configurations?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I haven't done much with defining an MSBUILD configuration file but I have done builds of different configurations using a batch file like this

msbuild /v:n /p:Configuration=Release "Capture.sln" 
msbuild /v:n /p:Configuration=ReleaseNoUploads "Capture.sln" 

I defined the ReleaseNoUploads configuration inside Visual Studio.

Here's what I had to do for that (this is Visual Studio 2005):

  • Open the Tools:Options menu, go to the Projects and Solutions:General option, and check Show advanced build configurations.
  • From there, go to the Build:Configuration Manager menu
  • In the dialog that pops up, click on the Active solution configuration pulldown and click <New...> to create a new build configuration.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...