ASP.NET Core: You must add a reference to assembly mscorlib, version=4.0.0.0

1753 단어
ASP.NET Core가 외부 패키지를 참조할 때 다음과 같은 오류가 발생할 수 있습니다.
The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Sample.Infrastructure..NETStandard,Version=v1.6
해결 방법: 인용 추가"Microsoft.NETCore.Portable.Compatibility": "1.0.0".
{
  "version": "1.0.0-*",

  "dependencies": {
    "NETStandard.Library": "1.6.0",
    "Microsoft.NETCore.Portable.Compatibility": "1.0.0"
  },

  "frameworks": {
    "netstandard1.6": {
      "imports": [ "dnxcore50", "net451", "portable-net45+win81" ]
    }
  }
}

참조 자료:
  • You must add a reference to assembly mscorlib, version=4.0.0
  • https://github.com/dotnet/coreclr/issues/5441
  • 좋은 웹페이지 즐겨찾기