Add Reference option missing from Solution Explorer

Viewed 10455

I'm using Visualstudio 2017 and need to add a reference for System.IO.Ports. However I can't find the Add Reference option (in any right-click menu in the solution explorer) nor instructions on how to do this. Help please? Thank you

4 Answers

When you create a new project you can choose several templates of c# application. If you select "Console App (.NET Framework)" you will be able to add references But if you select "Console App (.NET Core)" there will be no reference tab

After project is created you can check it via "Project properties" / Application / Target Framework:

".NET Core 2.0" (has no references) or ".NET Framework 4.6.1" (has preferences)

As far as I understand in your case the most simple solution is to create new project and to copy you code into it.

In my case, I used NuGet Packages. This solution is half working, but you can add reference to most popular libraries.

Ref to System.IO.Ports

You need to install more tools and features as it sounds like you are attempting to import a JAVA file and Visual Studio 2019 does not support Java development as it claims to.

Related