How to get rid of msbuild warning MSB3644

Go To


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

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.

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.

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.

2012-04-04 06:33
by David Ebbo
This SO post addresses the same issue, even though that's not obvious from the title: - John Hart 2015-08-19 20:28


NoWarn applies to compilation warnings thrown by the Csc and Vbc tasks.

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.

.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

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

2012-04-04 07:39
by KMoraz
Thanks for your answer. I just tried it and unfortunately it doesn't appear to work. I still get the exact same warning after adding /p:TargetFrameworkMoniker=".NETFramework,Version=v4.0" to the msbuild command line. : - David Ebbo 2012-04-04 17:45
Did you try passing other versions? or maybe you need references to Profile=ClientKMoraz 2012-04-04 19:08
'Client' by itself appears to be invalid ("FrameworkName cannot have less than two components or more than three components"). My guess is that this flag tells msbuild which target libraries to use assuming their SDK is installed. With no SDK on the machine, it may be that it doesn't do much - David Ebbo 2012-04-04 22:40
Hmmm, just found this page, and apparently it is not possible: It says "Warnings with MSB prefix are thrown by MSBuild. Currently, we can't suppress MSBuild warnings - David Ebbo 2012-04-04 22:42
that thread is not about MSBuild 4.0 though. Above I meant .NET Framework, Version=v4.0, Profile=Client not the client itself. For this property suppressed the exact warning - KMoraz 2012-04-04 22:52
That doesn't work either. Have you actually seen a case were adding this flag made this specific warning go away - David Ebbo 2012-04-05 05:15