.net - 安装了多个.net核心SDK(不同版本),我可以保持最新吗?

标签 .net .net-core

我最近一直在使用 Visual Studio 社区 IDE 开发一些应用程序,我刚刚看到多个 .NET Core SDK 安装在我的桌面上,次要版本更新略有不同。 (可能与微软推送的 VS 更新一起安装)

问题:
我可以只保留最新版本吗? (例如案例中的 2.1.103)。

或者我必须保留所有这些版本(每个大小约为 460MB)以保持 Visual Studio 正常工作,考虑到我的 SSD 可用空间不足(最终),这太疯狂了......

multiple .net core SDKs installed

最佳答案

答案是可以的。如果您想尝试一下,只需卸载所有内容并从 https://dot.net 重新安装最新的 SDK。 .它会工作的。但请确保保留您需要的那个,因为如果您自己的项目声明指定了 SDK,则您需要该特定的 SDK。但是有一个问题,向下滚动。

https://github.com/dotnet/docs/issues/4241

引用比尔瓦格纳的话,

In summary, the .NET Core SDK is backwards compatible and the newest one on the box is used unless there is a global.json file that indicates another version of the SDK.

So, the short answer is:

  • You need the one you want to run (latest suggested and previews should be fine) * And, any that are specified in global.json

If a SDK version is in a global.json on your machine, and you do not have that version, you will roll forward across patch, but not feature versions of the SDK. Except that the roll forward behavior is overly aggressive in the the 2.1.x -> 2.1.300 range. For that range, we recommend you not do roll forward but have the specified version available.



关键就在这里。

One correction.

By the time 2.1.300 ships, we will not rollforward from 2.1.x to 2.1.300. We will keep within the boundaries of the release.

So:

2.1.x => 2.1.1, 2.1.9, 2.1.10… 2.1.100 => 2.1.100, 2.1.101, 2.110… 2.2.200 > 2.1.200, 2.1.201,…



正如 Kathleen Dollard 所引用的,您需要按照本指南根据您的项目在特定版本的 SDK 上进行开发。

要检查当前机器在 macOS 上安装的 SDK:
 ✘ nixholas@Nicholass-MacBook-Pro  ~/Projects/nozomi   staging  dotnet --list-sdks
1.0.3 [/usr/local/share/dotnet/sdk]
1.0.4 [/usr/local/share/dotnet/sdk]
2.0.0-preview2-006497 [/usr/local/share/dotnet/sdk]
2.0.0 [/usr/local/share/dotnet/sdk]
2.1.4 [/usr/local/share/dotnet/sdk]
2.1.101 [/usr/local/share/dotnet/sdk]
2.1.104 [/usr/local/share/dotnet/sdk]
2.1.300-rc1-008673 [/usr/local/share/dotnet/sdk]
2.1.300 [/usr/local/share/dotnet/sdk]
2.1.301 [/usr/local/share/dotnet/sdk]
2.1.400 [/usr/local/share/dotnet/sdk]
2.1.402 [/usr/local/share/dotnet/sdk]
2.1.500 [/usr/local/share/dotnet/sdk]
2.2.101 [/usr/local/share/dotnet/sdk]
2.2.103 [/usr/local/share/dotnet/sdk]
2.2.104 [/usr/local/share/dotnet/sdk]
2.2.105 [/usr/local/share/dotnet/sdk]
2.2.300 [/usr/local/share/dotnet/sdk]
2.2.301 [/usr/local/share/dotnet/sdk]

关于.net - 安装了多个.net核心SDK(不同版本),我可以保持最新吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49869580/

相关文章:

c# - 使用 .NET 开发新的应用程序?

javascript - 我必须使用 javascript 显示超过 20,000 条记录,但这需要很多时间

c# - Microsoft 图表控件和 X 轴时间刻度格式

c# - 我只看到项目模板 blazorserver,为什么我看不到项目模板 blazor、blazorhosted、blazorlib、blazorserverside?

.net-core - 使用 RabbitMQ 发布/订阅微服务事件总线时如何去重事件

c# - 从 Web 方法动态返回字段

c# - 工作流是否适合在基于 Web 的应用程序中创建动态工作流?

authentication - 我们可以在 Asp.NET Core 中销毁/无效 JWT token 吗?

c# - 消息模板应为编译时间常数

c# - 等待 IAsyncResult 函数完成