无法在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.
- 右键单击您的项目
- 选择管理Nuget程序包"
- 从列表中找到要添加的软件包