Ufu*_*arı 5 .net msbuild visual-studio .net-4.5 visual-studio-2012
我写了一个小的MSBuild脚本来构建我的多个版本的项目.当我从VS2012命令提示符运行它时,它没有任何错误或异常.但是,当我比较生产的组件时,它们是相同的.我的剧本有什么问题吗?
<Target Name="Build">
<MSBuild Projects=".\WcfClientBase\WcfClientBase.csproj"
Properties="Configuration=Release;OutputPath=.\BuildArtifacts\net45;TargetFrameworkVersion=v4.5" />
<MSBuild Projects=".\WcfClientBase\WcfClientBase.csproj"
Properties="Configuration=Release;OutputPath=.\BuildArtifacts\net40;TargetFrameworkVersion=v4.0" />
<MSBuild Projects=".\WcfClientBase\WcfClientBase.csproj"
Properties="Configuration=Release;OutputPath=.\BuildArtifacts\net35;TargetFrameworkVersion=v3.5" />
</Target>
Run Code Online (Sandbox Code Playgroud)
我安装了VS2012 Professional.我还注意到.NET 4.5没有自己的MSBuild.exe.它是使用4.0版本的吗?
更新
我使用Visual Studio为每个版本构建它,并且所有程序集都不同.我的脚本有问题.我故意错误输入TargetFrameworkVersion参数名称,但它仍然构建并生成相同的输出.也许它无法从项目文件中覆盖该参数,或者我还缺少其他参数.还有什么想法吗?
您还需要自定义 IntermediateOutputPath 属性,否则所有 3 种风格共享相同的中间目录obj\Release。尝试这个:
<Target Name="Build">
<MSBuild Projects="WcfClientBase\WcfClientBase.csproj"
Properties="Configuration=Release;OutputPath=BuildArtifacts\net45\;IntermediateOutputPath=obj\Release\net45\;TargetFrameworkVersion=v4.5" />
<MSBuild Projects="WcfClientBase\WcfClientBase.csproj"
Properties="Configuration=Release;OutputPath=BuildArtifacts\net40\;IntermediateOutputPath=obj\Release\net40\;TargetFrameworkVersion=v4.0" />
<MSBuild Projects="WcfClientBase\WcfClientBase.csproj"
Properties="Configuration=Release;OutputPath=BuildArtifacts\net35\;IntermediateOutputPath=obj\Release\net35\;TargetFrameworkVersion=v3.5" />
</Target>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
824 次 |
| 最近记录: |