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

查看:991
本文介绍了无法在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天全站免登陆