Skip to content

Commit e83febc

Browse files
authored
1 change by Nuxt Studio
1 parent a2efd57 commit e83febc

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

content/1.posts/64.manage-dotnet-versions.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ tags:
1010
- csharp
1111
- .NET
1212
- advent
13-
ImageAttribution: Picture of <a href="https://unsplash.com/fr/@cbpsc1">Clint Patterson</a> on <a href="https://unsplash.com/fr/photos/macbook-pro-sur-table-en-bois-marron-yGPxCYPS8H4">Unsplash</a>
13+
ImageAttribution: Picture of <a href="https://unsplash.com/fr/@cbpsc1">Clint
14+
Patterson</a> on <a
15+
href="https://unsplash.com/fr/photos/macbook-pro-sur-table-en-bois-marron-yGPxCYPS8H4">Unsplash</a>
1416
---
1517

1618
With a new .NET version released each year, an LTS version every three years, and regular patches, you likely have multiple .NET SDK versions installed on your computer. Some may need updating, while others should be removed because they are no longer supported. In this article, we will explore 5 effective ways to manage your .NET SDK versions.
@@ -23,7 +25,7 @@ You can check the supported and unsupported versions of .NET [here](https://dotn
2325

2426
With the `dotnet --list-sdks` command you can display the installed SDKs (same thing for installed runtimes with the command `dotnet --runtimes`).
2527

26-
![Command line interface displaying installed .NET SDK versions: 6.0.201, 6.0.302, 8.0.303, and 9.0.101 with their corresponding installation paths.](/posts/images/64.dotnet-versions-1.png){.rounded-lg .mx-auto width=800}
28+
![Command line interface displaying installed .NET SDK versions: 6.0.201, 6.0.302, 8.0.303, and 9.0.101 with their corresponding installation paths.](/posts/images/64.dotnet-versions-1.png){.rounded-lg.mx-auto width="800"}
2729

2830
So it’s not too complicated to make a script to uninstall these. It will help you free some space!
2931

@@ -33,30 +35,32 @@ Instead of doing your own script, you can use the [.NET Uninstall Tool](https://
3335

3436
With the `dotnet-core-uninstall list` command, you can see the .NET versions that can be uninstalled. As you can see, it also identifies which versions are used by Visual Studio.
3537

36-
![Command line interface displaying a tool for uninstalling specific versions of .NET Core SDKs, Runtimes, and Hosting Bundles, with a list of available versions that can be uninstalled.](/posts/images/64.dotnet-versions-2.png){.rounded-lg .mx-auto width=1000}
38+
![Command line interface displaying a tool for uninstalling specific versions of .NET Core SDKs, Runtimes, and Hosting Bundles, with a list of available versions that can be uninstalled.](/posts/images/64.dotnet-versions-2.png){.rounded-lg.mx-auto width="1000"}
3739

3840
You can then uninstall .NET versions using the `dotnet-core-uninstall remove` command which has interesting options like `--all-but` to remove all .NET SDKs and runtimes except the ones specified.
3941

4042
## 3 - Use Visual Studio installer
4143

4244
If you are using Visual Studio, updating it to the latest version will automatically update the .NET versions too. You can also use the installer to add specific .NET versions in the individual components section.
4345

44-
![The image shows the Visual Studio Installer interface, focusing on the "Individual components" tab. Several .NET runtimes and SDKs are listed with checkboxes. Among them, .NET 6.0 Runtime (Long Term Support), .NET 7.0 Runtime, .NET 8.0 Runtime (Long Term Support), .NET 9.0 Runtime, and .NET Aspire SDK are checked. Some runtimes are marked as "Out of support."](/posts/images/64.dotnet-versions-3.png){.rounded-lg .mx-auto width=1000}
46+
![The image shows the Visual Studio Installer interface, focusing on the "Individual components" tab. Several .NET runtimes and SDKs are listed with checkboxes. Among them, .NET 6.0 Runtime (Long Term Support), .NET 7.0 Runtime, .NET 8.0 Runtime (Long Term Support), .NET 9.0 Runtime, and .NET Aspire SDK are checked. Some runtimes are marked as "Out of support."](/posts/images/64.dotnet-versions-3.png){.rounded-lg.mx-auto width="1000"}
4547

4648
## 4 - Use a package manager like winget
4749

4850
The easiest way to manage your .NET versions is by using a package manager. This is likely how you already handle your other software and tools, so why not use it for .NET SDKs and runtimes too?
4951

5052
For Mac or Linux, you can use homebrew for instance. For Windows I like to use winget.
5153

52-
![A command-line interface displays search and list results for Microsoft .NET SDKs using the tool. The search results show different versions from SDK 3.1 to 9.0 Preview, while the list shows installed versions 6.0.302 and 8.0.303.](/posts/images/64.dotnet-versions-4.png){.rounded-lg .mx-auto width=1000}
54+
![A command-line interface displays search and list results for Microsoft .NET SDKs using the tool. The search results show different versions from SDK 3.1 to 9.0 Preview, while the list shows installed versions 6.0.302 and 8.0.303.](/posts/images/64.dotnet-versions-4.png){.rounded-lg.mx-auto width="1000"}
5355

5456
With the following command `winget install Microsoft.DotNet.SDK.9`, I can install the .NET 9 SDK.
5557

5658
## 5 - Use Dots the friendly .NET SDK manager
5759

5860
[Dots](https://github.com/nor0x/Dots) is my latest discovery, which I found while looking for a way to uninstall old .NET versions, and it's fantastic. It's an open-source project that offers a GUI to search, install, and uninstall SDKs. What I love about it is that you can see a lot of useful information about the versions, such as their support status, whether they are LTS, and if they are already installed. There are also filters to quickly see which versions you should update or cleanup.
5961

60-
![A software management interface displays various versions of .NET, including 9.0.101 and earlier previews. Each version has options to download, install, or uninstall. Details for version 9.0.101 include release notes, release date, and supported languages like C#. Download links for different Linux architectures are available.](/posts/images/64.dotnet-versions-5.png){.rounded-lg .mx-auto width=1000}
62+
![A software management interface displays various versions of .NET, including 9.0.101 and earlier previews. Each version has options to download, install, or uninstall. Details for version 9.0.101 include release notes, release date, and supported languages like C#. Download links for different Linux architectures are available.](/posts/images/64.dotnet-versions-5.png){.rounded-lg.mx-auto width="1000"}
6163

6264
To summarize, there are various ways to manage your .NET SDK versions. This can help free up space and ensure your system is up-to-date with supported versions. Using a package manager like `winget` is my preferred method for managing .NET versions. However, other tools like Dots or the .NET Uninstall tool can also be very helpful at times.
65+
66+
This article was published as part of the [C# Advent 2024](https://techwatching.dev/posts/manage-dotnet-versions) which is a nice initiative. Make sure to check the other blog articles on the advent calendar.

0 commit comments

Comments
 (0)