- Install latest stable Visual Studio 2019 16.4.2 (check .NET Core Development and Desktop development with C++ workloads, also make sure that C++/CLI support component in checked).
- Create new project with CLR Class Library (.NET Core) template (or CLR Empty Project (.NET Core) if you like).
- Compilation via dotnet build command will fail (dotnet build CLRNetCoreTest.sln /p:Configuration=Debug /p:Platform=x86):
Compilation via msbuild command is successfull ("%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" CLRNetCoreTest.sln /p:Configuration=Debug /p:Platform=x86).
And that is very strange - I supposed dotnet to be a wrapper built on the top of msbuild..
Sample project is attached (run Build.bat for compilation).