Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Visual Studio Solution file only in VS 2019

I was using .NET Core API project with 2.2 Framework in VS 2017. Now we have migrated all the .NET Core API Projects to 3.0 Framework.I have both VS 2017 and 2019 installed in my machine. When we click on ".sln" file it gets openend in VS 2017. But i want the .sln file to be openend in VS 2019. Please let me know the changes required to achieve this.

Thanks

like image 931
Avinash Avatar asked Nov 26 '19 09:11

Avinash


People also ask

Can I open VS 2019 project in VS 2017?

Visual Studio 2019 can open projects created in Visual Studio 2013, Visual Studio 2015, and Visual Studio 2017.


Video Answer


2 Answers

For one, you can delete the solution file and create a new one dotnet new sln.

Assuming you have .NET Core 3.0 sdk installed and active (in case of globa.json being present), it should create you an *.sln file for VS 2019.

Alternatively edit your sln and change the first few lines to

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29512.175
MinimumVisualStudioVersion = 10.0.40219.1

thats the sln header VS 2019.4 (16.4) creates on new solutions

like image 74
Tseng Avatar answered Oct 22 '22 04:10

Tseng


  1. Right-click on the .sln file
  2. From the popup menu click on "Open with" and in the submenu click on "Choose another app"

Context menu screenshot

  1. In the splash window select "Microsoft Visual Studio Version Selector", don't forget to tick the "Always use this app to open .sln files" checkbox, and click "OK".

How do you want to open this file? - screenshot

  1. If prompted to save changes to the "devenv.sln" file, save changes.

In this way, a double click on a .sln should open it with the version of Visual Studio that was used to create it.

like image 26
Fry Simpson Avatar answered Oct 22 '22 03:10

Fry Simpson