I just downloaded Visual Studio for Mac and for some reason in some projects I've made, I can change the target framework, but most of the time it's greyed out:
Does anyone know how to always be able to change the target framework?
I just downloaded Visual Studio for Mac and for some reason in some projects I've made, I can change the target framework, but most of the time it's greyed out:
Does anyone know how to always be able to change the target framework?
It turns out I had used the wrong template when I was first creating the solution. I should have used this one:
When used, it allows me to select the proper Target Framework.
Currently Visual Studio for Mac, with a .NET Core project, will only allow you to select those .NET Core target frameworks which are installed on your local machine.
The current .NET Core SDK that is installed with the Visual Studio for Mac installer includes the runtimes for .NET Core 2.1 so only 2.1 is available in the project options for the target framework.
On my machine, for example, I have 2.1, 2.0, 1.1 and 1.0 installed so I can choose all versions in the project options.
The About dialog shows you what .NET Core SDKs are installed.
You can see more .NET Core SDK information in the main Preferences dialog, as shown below:
The target frameworks available for .NET Framework projects has more options since Mono supports a wider range of framework versions.