无法更改目标框架? [英] Cannot Change Target Framework?

查看:43
本文介绍了无法更改目标框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天早上我遇到了这个问题,我无法更改开源项目的目标框架.目标框架"选项下拉列表处于非活动状态/已禁用.如何使其与.NET Framework 2.0兼容?

这是下载链接:

解决方案

现代的类库现在应该使用多个目标框架,这意味着这些选项现在只能在项目文件中设置.

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

https://docs.microsoft.com/en-us/dotnet/标准/框架

Visual Studio尚没有合适的UI元素来反映这些选项,这就是为什么以您看到的方式显示它的原因.

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.

解决方案

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.

这篇关于无法更改目标框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆