MSBuild "Configuration" and "OutDir" Properties

Hi!

We have a preliminary MSBuild script that calls a solution to compile a ASP.NET 2.0 project like so:

<MSBuild Projects="WebApp1.sln" Properties="Configuration=Release;OutDir=../webapp1_deploy/"/>

We're pretty new to MSBuild so bear with us, but how does MSBuild know to interpret the "Properties" From what we can gather,

- Configuration=Release tells the solution file to use 'Release.AspNetCompiler.Debug="false";'

and

- OutDir=../webapp1_deploy/ tells the solution file to set 'Release.AspNetCompiler.TargetPath="../webapp1_deploy/"'

Is there a listing of possible "Properties" and what they mean and map to What we have is working, but we're not 100% how the puzzle is put together.




Answer this question

MSBuild "Configuration" and "OutDir" Properties

  • DanielG

    I don't believe we have any documentation on msbuildemitsolution, although there's not much to say beyond what you've already seen.

    For the different $, %, and @, you can look at the MSBuild Concepts documentation at http://msdn2.microsoft.com/en-us/library/ms171451(VS.80).aspx. In a nutshell:

    • $() is used when you are referring to a property created inside a <PropertyGroup>
    • @() is used when you are referring to a list of items created inside an <ItemGroup>
    • %() is when you are accessing metadata on an item

    I agree, it is confusing...

    Neil



  • chadr - msft

    Hi Jay. We'll we got our web project file and I've went through it this morning. I can now see were my "Configuration" and "OutDir" settings are used so that makes sense. For our reference, is there any documentation about creating the static web project file using "msbuildemitsolution=1"

    I know MSBuild is still in its infancy so there are probably enhancements on the way, but compared to NAnt and Ant I think you've got a ways to go for usability.

    Lastly Jay, can you point me to a reference for when and why we need to use $(), %(), or @() I see all three of them are used in the project file that is created and I'm not sure what differentiates them.



  • Phil Brammer

    Thanks Jay! I've got the env value set so we'll see what we find after tonight's build.



  • Anjum Ali

    Hi,

    Msbuild is only capable of building project files. When building solution files (specify snl files in command line or in projects parameter in the msbuild task) using msbuild, msbuild will generate a project file based on the information from the solution file and build the project file.

    By setting the environment variable msbuildemitsolution=1 you will be able to see the project file generated by msbuild. The file created will be as <solutionfilename>.sln.proj.

    You can than open the proj file and examine the properties under <PropertyGroup> for list of properties being used. The properties that you specify in command like with /p switch or the properties parameter in the msbuild task will replace the exisitng properties defined in the project file. If the propery is not already defined in the project file or the imported project file than a new property will be created.

    Please let me know if you have any additional questions or concerns and I will be glad to assist you.

    Thank you,

    Regards

    Jay Shrestha

    (jaysh@microsoft.com)


  • MSBuild "Configuration" and "OutDir" Properties