在以下代码示例中,双引号用于在由项目文件输出的消息中突出显示文件名。
<Project DefaultTargets="Compile"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
<!-- Set the application name as a property -->
<PropertyGroup>
<appname>"HelloWorldCS"</appname>
</PropertyGroup>
<!-- Specify the inputs -->
<ItemGroup>
<CSFile Include = "consolehwcs1.cs" />
</ItemGroup>
<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 -->
<Output
TaskParameter = "OutputAssembly"
ItemName = "EXEFile"/>
<!-- Log the file name of the output file -->
<Message Text="The output file is "@(EXEFile)"."/>
</Target>
</Project>
MSBuild 参考
MSBuild