MSBuild未计算生成中的参数
我在Visual Studio中使用以下自定义项目类型:MSBuild未计算生成中的参数,msbuild,Msbuild,我在Visual Studio中使用以下自定义项目类型: <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <TestNode>$(Configuration)</TestNode> 正确调用属性组,但TestNode不包含“Released”,而是包含“$(Configuration)”。。。有什么想法吗?尝试在引用属性的地方用引号括起来:“$(配置)” 释放 输出:这
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TestNode>$(Configuration)</TestNode>
正确调用属性组,但TestNode不包含“Released”,而是包含“$(Configuration)”。。。有什么想法吗?尝试在引用属性的地方用引号括起来:“$(配置)”
释放
输出:这是一个测试版本'worksforme'
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<SomeData>$(Configuration)</SomeData>
</PropertyGroup>
<Target Name="Bobby">
<Message Text="Value of SomeData is: $(SomeData)" />
</Target>
</Project>
也许这个答案可以帮助你正确地理解语法,如果不添加一个自包含的复制(并且回复这个答案,我会得到通知),我会看一看
<Target Name="Target1">
<PropertyGroup>
<Configuration>release</Configuration>
</PropertyGroup>
<Message Text="this is a test $(Configuration)" Importance="high" />
</Target>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<SomeData>$(Configuration)</SomeData>
</PropertyGroup>
<Target Name="Bobby">
<Message Text="Value of SomeData is: $(SomeData)" />
</Target>
</Project>
C:\Users\mvine\Desktop>msbuild Test.fooproj /p:Configuration=Release /t:Bobby
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18033]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 24/05/2013 10:06:14.
Project "C:\Users\mvine\Desktop\Test.fooproj" on node 1 (Bobby target(s)).
Bobby:
Value of SomeData is: Release
Done Building Project "C:\Users\mvine\Desktop\Test.fooproj" (Bobby target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.03