使用 MSBuild 定位特定版本的 .NET [英] Target specific version of .NET with MSBuild

查看:15
本文介绍了使用 MSBuild 定位特定版本的 .NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 MSBuild 项目正在引用的解决方案.在解决方案中,我引用了几个面向 .NET 4.0 的项目.如何告诉 MSBuild 忽略项目的配置,只针对 .NET 3.5?

I have a solution that is being referenced by a MSBuild project. In the solution, I am referencing several projects that are targeting .NET 4.0. How can I tell MSBuild to ignore the project's configuration and just target .NET 3.5?

推荐答案

类似下面的命令应该可以工作

A command similar to the following should work

msbuild YourSolution.sln /tv:3.5 /p:TargetFrameworkVersion=v3.5

msbuild YourSolution.sln /p:TargetFrameworkVersion=v3.5

/tv(或/toolsversion)表示您要使用的MSBuild 工具的版本,属性TargetFrameworkVersion 表示目标框架.在您的情况下,只需指定该属性就可以了,但如果您想使用 3.5 MSBuild 工具集,您可以像我在第一个命令中所做的那样使用/tv 对其进行 sepcify.

/tv (or /toolsversion) Indicates which version of the MSBuild tools you want to use, and the property TargetFrameworkVersion indicates the target framework. In your case just specifying that property should be fine, but if you want to use the 3.5 MSBuild toolset you can sepcify it with /tv as I did in the first command.

这篇关于使用 MSBuild 定位特定版本的 .NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆