I'm trying to build a .NET 4.7 project from MSBuild. It is building fine from VS 2017, however, MSBuild fails with the following error message:
Program.cs(25,18): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a ref
erence to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [C:\work\automation\Apps\First\src\First\First.csproj]
Program.cs(24,27): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a ref
erence to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [C:\work\automation\Apps\First\src\First\First.csproj]
I'm not sure why it is requesting netstandard 2.0, this is not my project, but my guess is that some of the dependency requires netstandard. Anyway, I have added netstadard 2.0 reference through nuget (although, public key differs from the one shown in the error msg), but the problem still persists. Any idea what could be wrong?
Thanks