Add Reference to Visual Studio 2019

Asked

Viewed 272 times

0

I used Visual Studio 2017, and had an area to add reference. When I switched to Visual Studio 2019, I noticed that the button changed its name. inserir a descrição da imagem aqui

When I try to add a reference it doesn’t work,

inserir a descrição da imagem aqui

the box does not remain checked and a new field appears.

inserir a descrição da imagem aqui

  • It’s an app. Net Framework or . Net Core? Usually you go in "assemblies" and not in search. For applications . Net Core you have to install the corresponding nuget. I remember that before there was System.Windows.Forms in nuget Manager, but it looks like it was removed. Anyway I found this question that may help you: https://stackoverflow.com/questions/38460253/how-to-use-system-windows-forms-in-net-core-class-library

  • If it’s an app. Net Framework (and your visual studio is well updated) there is a more practical way: type Form F1 = new Form(); in your code, place the cursor on top of the Form ( setting that will be underlined in red) and press Ctr+. (control dot). A menu will appear, select "using System.Windows.Forms". It will add the reference and using instruction automatically. The visual studio uses some matching algorithm and sometimes even finds which package should be installed, but it doesn’t always work, and this only works in the latest versions.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.