c# - Visual Studio 2017 错误 : Cannot find project info for “” This can indicate a missing project reference - with Console App . NET Core 2.1

标签 c# .net-core .net-standard

  • 对比 15.7.5

我有一个 .NET Standard 2.0 类库:

enter image description here

它存在于自己的解决方案中,但我现在已将它添加到不同的解决方案中,以便我可以将它与我的 .NET Core 2.1 控制台测试运行器一起使用:

enter image description here

但是,一旦我这样做,我就会收到错误。如果我删除 控制台应用程序,那么所有内容都可以正确编译。

那么我在这里缺少什么?为什么 .NET Core 2.1 控制台应用程序找不到我的 .NET Standard 2.0 类库?

最佳答案

我只是尝试复制您所做的,它对我有用!

我的 .net 2 标准 enter image description here

只有一个类

 public class School
    {
        public string Name => "Mango Hill";
    }

还有我的.net core 2.1项目

enter image description here

从库中调用类 enter image description here

你可以看到输出。 所以我建议您检查公共(public)项目,看看它是否引用了任何完整的库,然后尝试隔离引用。

关于c# - Visual Studio 2017 错误 : Cannot find project info for “” This can indicate a missing project reference - with Console App . NET Core 2.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51626748/

相关文章:

c# - 有没有比普通 .settings 文件更高级的常用方法来保存应用程序设置?

c# - 如何将对象传输到 Azure Blob 存储而不将文件保存在本地存储上?

c# - 循环浏览工作表

c# - 通过C#连接MySql数据库进行登录

c# - 静态字段初始化在 C# 中如何工作?

asp.net-core - ServiceProvider.GetRequiredService 与 ApplicationServies.GetRequiredService 与单例服务

c# - 如何使用 MSBuild NuGet 将 .csproj 文件加载到 .NET Core 3.0 中

c# - 在 .NET Standard/Core 中获取构造函数列表的等效项是什么?

wcf - 为 netstandard Xamarin.Forms 项目生成 WCF 客户端代理

.net - 考虑到目标之间的实现差异,如何正确地对具有多个目标框架的 .NET 项目进行单元测试?