Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot add assemblies to .Net Core application in Visual Studio 2019

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:

enter image description here

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

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

like image 837
hdkrus Avatar asked Jun 26 '19 12:06

hdkrus


People also ask

How do I add assembly reference to net core project?

One method of adding references to your library is by typing it directly in the project. json file. As you can see that we have added some references under the dependencies section as shown in the following code. Let us now save this file and you will see that references are added to your library now.


1 Answers

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. Right click your project
  2. Choose "Manage Nuget Packages"
  3. Find the package you want to add from the list
like image 138
Robert Perry Avatar answered Dec 10 '22 17:12

Robert Perry