Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

How to: Use Reserved XML Characters in Project Files

When you author project files, you might need to use reserved XML characters, for example, in property values or in task parameter values. However, some reserved characters must be replaced by a named entity so that the project file can be parsed.

The following table describes the reserved XML characters that must be replaced by the corresponding named entity so that the project file can be parsed.

Reserved character

Named entity











To use double quotes in a project file

  • Replace the double quotes with the corresponding named entity, &quot;. For example, to place double quotes around the EXEFile item collection, type:

    <Message Text="The output file is &quot;@(EXEFile)&quot;."/>

In the following code example, double quotes are used to highlight the file name in the message that is output by the project file.

<Project DefaultTargets="Compile"
    xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
    <!-- Set the application name as a property -->
    <!-- Specify the inputs -->
        <CSFile Include = "consolehwcs1.cs" />
    <Target Name = "Compile">
        <!-- Run the Visual C# compilation using input
        files of type CSFile -->
        <Csc Sources = "@(CSFile)">
            <!-- Set the OutputAssembly attribute of the CSC task
            to the name of the executable file that is created -->
                TaskParameter = "OutputAssembly"
                ItemName = "EXEFile"/>
        <!-- Log the file name of the output file -->
        <Message Text="The output file is &quot;@(EXEFile)&quot;."/>


Other Resources

Community Additions

© 2015 Microsoft