文章出處

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" ]
    }
  }
}

參考資料:


文章列表




Avast logo

Avast 防毒軟體已檢查此封電子郵件的病毒。
www.avast.com


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()