简体   繁体   English

.NET Core SDK 2.2.1 和 .NET Framework 4.7.2 缺少 .NET Standard 2.0 Framework

[英]Missing .NET Standard 2.0 Framework with .NET Core SDK 2.2.1 & .NET Framework 4.7.2

I created a .NET Standard Class library which seems to point to 1.6, but when I go to change it to v2.0, I don't see it in the list:我创建了一个似乎指向 1.6 的 .NET 标准类库,但是当我将其更改为 v2.0 时,我没有在列表中看到它:

Visual Studio 项目属性窗格,目标框架选择打开和缺少 v1.6 之后的 .NET Standard 版本

Also attached is the latest info from my machine and versions, I have installed both the .NET Core 2.2.1 x64 & x86 SDKs and I have the .NET Full Framework 4.7.2.还附上了我的机器和版本的最新信息,我已经安装了 .NET Core 2.2.1 x64 和 x86 SDK,并且我有 .NET Full Framework 4.7.2。 I'm using VS 2017, v15.9.3.我正在使用 VS 2017,v15.9.3。

Visual Studio 安装修改面板

Just reinstalled VS, here's how that looked:刚刚重新安装 VS,这是它的样子:

CMD 和 Visual Studio 安装程序显示已安装的 dotnet 版本和 VS 版本

Reinstalling VS did not end up working, so I tried reinstalling Windows and then VS, which did the trick... Is there an easier, more consistent way to fix this?重新安装 VS 并没有成功,所以我尝试重新安装 Windows,然后重新安装 VS,这成功了……有没有更简单、更一致的方法来解决这个问题?

My team got into this issue.我的团队陷入了这个问题。 Though we installed all.Net Core SDK but VS2017 targer framework was showing up to.Net Standard 1.6.虽然我们安装了 all.Net Core SDK,但 VS2017 目标框架显示为 .Net Standard 1.6。 After searching a lot, we found all.Net Core SDK versions installed(latest till 2.2.10) are 64 bit except one 2.2.301 which is x86 version.经过大量搜索,我们发现所有安装的 .Net Core SDK 版本(最新到 2.2.10)都是 64 位的,除了一个 2.2.301 是 x86 版本。

Command dotnet --info helped us to find the same.命令dotnet --info帮助我们找到相同的。 In dotnet --info output, Base path was pointing to C:\Program Files (x86)\dotnet\sdk\2.2.301\在 dotnet --info 输出中,基本路径指向 C:\Program Files (x86)\dotnet\sdk\2.2.301\

SDK paths: C:\Program Files\dotnet\sdk SDK路径:C:\Program Files\dotnet\sdk

C:\Program Files (x86)\dotnet\sdk C:\Program Files (x86)\dotnet\sdk

Finally, we uninstalled the x86 version and then the Environment path reset and pointed to 64 bits SDKs as shown in below diagram.最后,我们卸载了 x86 版本,然后重置环境路径并指向 64 位 SDK,如下图所示。 Now, targer framework is pointing to.Net Standard 2.0.现在,目标框架指向.Net Standard 2.0。 在此处输入图像描述

I just ran into this issue.我刚遇到这个问题。 Reinstalling the sdk and VS didn't help.重新安装 sdk 和 VS 没有帮助。 The issue ended up being an incorrect order of paths in the System Path variable.问题最终是系统路径变量中的路径顺序不正确。 As soon as I moved C:\Program Files\dotnet\ before C:\Program Files (x86)\dotnet\ VS was able to pickup the correct sdks.只要我移动C:\Program Files\dotnet\之前C:\Program Files (x86)\dotnet\ VS 就能够获取正确的 sdks。

系统路径变量

I had the very same problem, even went as far as reporting it to Microsoft.我遇到了同样的问题,甚至向微软报告了。 It only happens with a clean install, so people checking it on their long used and upgraded systems wouldn't be able to help.它只发生在全新安装时,因此人们在他们长期使用和升级的系统上检查它将无济于事。

But, after many desperate tries and giving up, I switched off the computer and fired it up next morning.但是,在多次绝望的尝试和放弃之后,我关掉了电脑,第二天早上启动了它。 And VS was working all right, with the 2.0 where it should be. VS 工作正常,2.0 在它应该的地方。

I know this isn't a proper, reliable and repeatable solution but maybe it'll spare the trouble of reinstalling everything for somebody... :-)我知道这不是一个合适的、可靠的和可重复的解决方案,但也许它会省去为某人重新安装所有东西的麻烦……:-)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当前.NET SDK在Visual Studio 2017更新15.9.3中不支持定位.NET Standard 2.0错误,已安装.NET Core 2.2.1 SDK - The current .NET SDK does not support targeting .NET Standard 2.0 error in Visual Studio 2017 update 15.9.3, .NET Core 2.2.1 SDK installed .NET Framework 4.6.2和.NET Standard 2.0不兼容 - .NET Framework 4.6.2 and .NET Standard 2.0 incompatibility 在 .Net Core 项目中使用 .Net Framework dll (v4.7.2) - Use .Net Framework dll (v4.7.2) in .Net Core project 如果我必须同时针对 Dot Net Core 3.0 和 .Net Framework 4.7.2,我应该在库中使用哪个 .Net 标准版本 - Which .Net standard version should i use in a library if i have to target both Dot Net Core 3.0 and .Net Framework 4.7.2 .net 标准库在 .net 核心中失败,但在框架中失败 - .net standard library fails in .net core but not in framework .NET Core SDK与在.NET Framework项目中使用.NET Standard库有什么关系? - How is the .NET Core SDK related to using .NET Standard libraries in .NET Framework projects? 哪个`[InternalsVisibleTo]`用于.NET Framework和.NET Standard / Core框架程序集? - Which `[InternalsVisibleTo]` for .NET Framework and .NET Standard / Core framework assemblies? .NET Core == .NET Framework 5 吗? - Is .NET Core == .NET Framework 5? 在.net核心和.net框架中使用.net标准包 - Using a .net standard package in .net core and .net framework .NET 框架? 还是 .NET 核心? 还是 .NET 标准? 或者以上都没有? - .NET Framework? Or .NET Core? Or .NET Standard? Or none of the above?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM