如何摆脱的MSBuild警告MSB3644 [英] How to get rid of msbuild warning MSB3644

查看:2112
本文介绍了如何摆脱的MSBuild警告MSB3644的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在建设工程机械,没有安装的SDK上的网络项目,你会得到这样的警告:

When building a web project on a machine that doesn't have the SDK installed, you get this warning:

警告MSB3644:参考组件的框架   .NETFramework,版本= V4.0均未发现。要解决此问题,安装   SDK或定位包这个框架版本或重新定位你的   应用到一个版本的框架您拥有的SDK   或者安装定位包。请注意,组件将得到解决   从全局程序集缓存(GAC)和代替将使用   引用程序集。因此,程序集可能不正确   针对你想让你的框架。

warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

显然,一种办法摆脱的警告是安装SDK。然而,在这种情况下,我只是希望坐席preSS此警告(其中大部分是无害的)从生成输出而不改变以任何其他方式的机器的状态

Obviously, one way to get rid of the warning is to install the SDK. However, in this case, I'm simply looking to suppress this warning (which is mostly harmless) from the build output without changing the state of the machine in any other way.

我试图通过/ P:NoWarn = 3644到的MSBuild(基于其他职位像<一个href="http://stackoverflow.com/questions/4318790/how-can-i-sup$p$pss-all-compiler-and-$c$c-analysis-warnings-from-msbuild-at-the-c">how我可以燮preSS MSBuild中所有的编译器和code分析警告在命令行?),但没有效果。

I tried passing /p:NoWarn=3644 to msbuild (based on other posts like how can i suppress all compiler and code analysis warnings from msbuild at the command line?), but that had no effects.

推荐答案

NoWarn 适用于抛出 CSC编译警告 Vbc的任务。

MSB *警告是核心的MSBuild警告。 为了燮preSS MSB3644警告传递一个明确的 TargetFrameworkMoniker

MSB* warnings are core MSBuild warnings. To suppress MSB3644 warning pass an explicit TargetFrameworkMoniker:

msbuild your.csproj /t:Rebuild /p:TargetFrameworkMoniker=".NETFramework,Version=v4.0"

可能的输入列表可以在这里找到

The list of possible inputs can be found here.

v1.1.4322
v2.0.50727
Client
v4.0
v4.0.30319
.NET Framework, Version=v4.0, Profile=Client
.NET Framework, Version=v4.0
.NET Framework, Version=v4.0.1, Profile=Client
.NET Framework, Version=v4.0.1
.NET Framework, Version=v4.0.2, Profile=Client
.NET Framework, Version=v4.0.2
.NET Framework, Version=v4.0.3, Profile=Client
.NET Framework, Version=v4.0.3
.NET Framework, Version=v4.5

在的MSBuild 4.5有一个新的标志 - <一个href="http://msdn.microsoft.com/en-us/library/microsoft.build.tasks.resolveassemblyreference.ignoreversionforframeworkreferences%28VS.110%29.aspx"相对=nofollow> IgnoreVersionForFrameworkReferences 可能来方便对这些警告。

In MSBuild 4.5 there's a new flag - IgnoreVersionForFrameworkReferences which might come handy on these warnings.

这篇关于如何摆脱的MSBuild警告MSB3644的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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