1

I had a default installation of VS Community 2019. Im trying to write a console app that automates some things my website is doing so I created a console project with the default settings -- VS automatically selected .NET Core 3.0. As I began began writing code, I needed to add a reference to System.Web. Other posts say that I need to target .NET Framework rather than .NET core so I head over to the Visual Studio SDKs page and install v4.8 Developer Pack. I reboot my computer and when I go back to the console app properties window, I still dont have .NET Framework in my Target framework dropdown. Re-running the installer results in it saying that it already exists.

How do I get .NET Framework to appear in my Target Framework drop down? Or better yet, how do I reference System.Web in my console app?

Note: There are many earlier posts that reference VS 2010 or 2012 that are no longer relevant to 2019.

Jeff
  • 13,943
  • 11
  • 55
  • 103

1 Answers1

1

You need to create a new project and specify when creating that it is .NET Framework rather than .NET Core:

enter image description here

You should then be able to just copy the code you already wrote to the new project and include the references you need

Notice that after creating the above project, only .NET Framework target options are available to me (I definitely have .NET Core installed as well` - so this is consistent with your situation):

enter image description here

If you don't want to do the above for some reason, you could look at this question and try something from there, but I really think its easier to just create a fresh project.

Bassie
  • 9,529
  • 8
  • 68
  • 159