无法将程序集添加到 Visual Studio 2019 中的 .Net Core 应用程序 [英] Cannot add assemblies to .Net Core application in Visual Studio 2019

查看:44
本文介绍了无法将程序集添加到 Visual Studio 2019 中的 .Net Core 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将缺少的程序集添加到我的项目(专门用于单元测试)时,我注意到添加引用"对话框中缺少程序集选项卡,请参阅:

When I try to add a missing assembly to my project (for unit testing specifically) I noticed that the Assemblies tab is missing in the "Add Reference" dialog , see:

这是错误还是预期行为?如果预期我们应该如何添加缺少的程序集.

Is this a bug or a expected behavior? If it's expected how we are supposed to add the missing assemblies.

请注意,我已经通过 Nuget 包管理器尝试过,但仍然无法正常工作.

Note that I already tried through Nuget package manager and still didn't work.

推荐答案

这是正确的行为.程序集选项卡不可用于 Net Core 项目.您将无法从您的系统添加程序集,因为 Net Core 项目使用来自 Nuget 的依赖项.因此,要添加引用,您需要改用 Nuget 包管理器.

It is correct behaviour. The Assemblies tab is not available for Net Core projects. You wont be able to add assemblies from your system, because Net Core projects work with dependencies from Nuget. So, to add your references, you need to use the Nuget Package Manager instead.

  1. 右键单击您的项目
  2. 选择管理 Nuget 包"
  3. 从列表中找到您要添加的包

这篇关于无法将程序集添加到 Visual Studio 2019 中的 .Net Core 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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