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.
So the WPF project, Foo, references .NET Standard 2.0 projects from the same solution.
My problem is with getting the solution to build on the TeamCity build server.
msbuild gives an error when building the solution (works fine in Visual Studio 2017).
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]
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).
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]
There isn't a projects.json file.
It's running with 15.0 version of msbuild
External Program Failed: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MsBuild.exe (return code was 1)