MSBuild incorrectly sets TargetFrameworkDirectories

When I try to create a C # console application (and possibly others), it seems that it is TargetFrameworkDirectoriesinstalled incorrectly; in particular, he omits the Facades catalog.

Since I tried to diagnose the problem for a while, here is a list of possible facts.

  • The problem appeared when trying to create a project in Visual Studio 2012 that referenced the Reactive Extension libraries (managed with NuGet). There was an error (or warning) warning MSB3267: The primary reference "System.Runtime", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.5". The problem occurs at runtime msbuildResolveAssemblyReference
  • I can reproduce the error from the command line using msbuild which seems simpler
  • Other workstations do not exhibit this problem. Running msbuild with verbosity appeared on a good machine, and on a bad machine there were some differences in the log file.
  • There is a TargetFrameworkDirectories(parameter ResolveAssemblyReference) on a good machine C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\, but on a bad machine it lacks a second record (Facades catalog)
  • Scanning through the good and bad msbuild log files causes the following differences:

    • Target AssignProjectConfigurationmissed in poor build but works in good layout
    • A number of goals, such as GetInstalledSDKLocations, are skipped in a good build, but not mentioned in a bad build
    • A task ResolveAssemblyReferenceis passed Assembliesin Implicit=truein a good build, but not in a bad build.
    • ResolveAssemblyReference TargetFrameworkDirectories C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\ , Facades (. ) .

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets, . . ( 17), TreatAsLocalProperty="OutDir" . , <!-- VS10 without SP1 and without VS11 will not have VisualStudioVersion set, so do that here -->. AssignProjectConfiguration, Condition="'$(CurrentSolutionConfigurationContents)' != '' or '@(ProjectReference)'!=''", - Condition="'@(ProjectReference)'!=''" ( , , ).

, , - "Microsoft.NET Framework 4.5" "Microsoft Multi-Targeting Pack Microsoft.NET Framework 4.5". .

, Visual Studio 2012!

: , .NET 4.5 "" VS2012 . , , , - Microsoft.Common.targets . , .

+5
1

@leppie, .NET. - .NET . .NET 4.5 ( VS2012), , .

0

All Articles