ASP.NET Core 5.0 错误 CS0012:“对象"类型在程序集“mscorlib"中定义 [英] ASP.NET Core 5.0 error CS0012: The type 'Object' is defined in assembly 'mscorlib

查看:37
本文介绍了ASP.NET Core 5.0 错误 CS0012:“对象"类型在程序集“mscorlib"中定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio 2015 中,我有一个 kproj,在这个项目中,我想添加对任何公共 nuget 包源中都不可用的程序集的引用,因此我创建了自己的 nuget 包,并且这种方式能够添加对此程序集的引用.

In Visual Studio 2015 I have a kproj, in this project I wanted to add a reference to an assembly that is not available in any public nuget package source, so I've created my own nuget package and this way was able to add the reference to this assembly.

问题是现在我收到以下异常:

The problem is that now I'm getting the following exception:

ASP.NET Core 5.0 错误 CS0012:在未引用的程序集中定义了类型对象".您必须添加对程序集 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 的引用.

ASP.NET Core 5.0 error CS0012: 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'.

关于如何克服这个问题有什么想法吗?

Any ideas on how to overcome this?

推荐答案

解决了.从 project.json 中删除了框架aspnetcore50"

Solved it. Removed the framework "aspnetcore50" from the project.json

这篇关于ASP.NET Core 5.0 错误 CS0012:“对象"类型在程序集“mscorlib"中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆