title: How to use MSBuild with WPF project that references net standard projects
body: <p>We're creating a new Windows application with a WPF interface. For various reasons, we are attempting to make all of the supporting libraries run on net standard 2.0.</p>
  
  <p>So the WPF project, Foo, references .NET Standard 2.0 projects from the same solution. </p>
  
  <p>My problem is with getting the solution to build on the TeamCity build server. </p>
  
  <p>msbuild gives an error when building the solution (works fine in Visual Studio 2017). </p>
  
  <p><strong>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(268,9): error MC1000: Unknown build error, 'Cannot resolve dependency to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.' [Src\Foo\Foo.csproj]</strong></p>
  
  <p>If I use nuget to add NetStandard.Library to the Foo project, then I get a different error from msbuild (still works fine in visual studio). </p>
  
  <p><strong>C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(178,5): error : Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet restore. [Src\Foo\Foo.csproj]</strong></p>
  
  <p>There isn't a projects.json file. </p>
  
  <p>It's running with 15.0 version of msbuild</p>
  
  <p>External Program Failed: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MsBuild.exe (return code was 1) </p>