我正在尝试从MSBuild构建.NET 4.7项目。从VS 2017开始可以正常运行,但是,MSBuild失败,并显示以下错误消息:
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]
我不确定为什么要请求netstandard 2.0,这不是我的项目,但是我猜测某些依赖项需要netstandard。无论如何,我通过nuget添加了netstadard 2.0参考(尽管公钥与错误msg中显示的参考不同),但问题仍然存在。知道有什么问题吗?
谢谢