首页 > 代码库 > ASP.NET Core: You must add a reference to assembly mscorlib, version=4.0.0.0
ASP.NET Core: You must add a reference to assembly mscorlib, version=4.0.0.0
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
ASP.NET Core: You must add a reference to assembly mscorlib, version=4.0.0.0
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。