Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Change Target Framework?

Tags:

c#

I came across this problem this morning that I can't change the target framework of an open source project. The Target framework option drop down is inactive/disabled. How to make it to work with .NET Framework 2.0?

This is the download link: https://dev.mysql.com/downloads/connector/net/6.10.html

By the way, possible duplicate question? The "Another Question" that had linked is for VS2008. I'm using VS2017, and today's date is 2018. The linked question is about 10 years old. Things changed a lot in 10 years. The solutions provided in that link is almost inapplicable.

Cannot Change Target Framework

like image 448
mjb Avatar asked Jan 12 '18 04:01

mjb


People also ask

How do I change my target framework to .NET core?

Change TargetIn the Solution Explorer, right-click on the project and select Edit Project File. Under the Target framework, you'll see the framework version option (net5. 0) and the option to change it.

Do you need vs2022 for .NET 6?

NET 6 is supported with Visual Studio 2022 and Visual Studio 2022 for Mac. It is not supported with Visual Studio 2019, Visual Studio for Mac 8, or MSBuild 16. If you want to use . NET 6, you will need to upgrade to Visual Studio 2022 (which is also now 64-bit). .


1 Answers

A modern class library should use multiple target frameworks today, which means the options can only be set in project files right now,

<Project Sdk="Microsoft.NET.Sdk">    <PropertyGroup>     <TargetFrameworks>netstandard1.4;net40;net45</TargetFrameworks>   </PropertyGroup> 

https://docs.microsoft.com/en-us/dotnet/standard/frameworks

Visual Studio does not yet have suitable UI elements to reflect the options, and that's why it is showed the way you saw.

like image 198
Lex Li Avatar answered Sep 19 '22 17:09

Lex Li