You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/1.posts/64.manage-dotnet-versions.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,9 @@ tags:
10
10
- csharp
11
11
- .NET
12
12
- 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
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
23
25
24
26
With the `dotnet --list-sdks` command you can display the installed SDKs (same thing for installed runtimes with the command `dotnet --runtimes`).
25
27
26
-
{.rounded-lg.mx-auto width=800}
28
+
{.rounded-lg.mx-auto width="800"}
27
29
28
30
So it’s not too complicated to make a script to uninstall these. It will help you free some space!
29
31
@@ -33,30 +35,32 @@ Instead of doing your own script, you can use the [.NET Uninstall Tool](https://
33
35
34
36
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.
35
37
36
-
{.rounded-lg.mx-auto width=1000}
38
+
{.rounded-lg.mx-auto width="1000"}
37
39
38
40
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.
39
41
40
42
## 3 - Use Visual Studio installer
41
43
42
44
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.
43
45
44
-
{.rounded-lg.mx-auto width=1000}
46
+
{.rounded-lg.mx-auto width="1000"}
45
47
46
48
## 4 - Use a package manager like winget
47
49
48
50
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?
49
51
50
52
For Mac or Linux, you can use homebrew for instance. For Windows I like to use winget.
51
53
52
-
{.rounded-lg.mx-auto width=1000}
54
+
{.rounded-lg.mx-auto width="1000"}
53
55
54
56
With the following command `winget install Microsoft.DotNet.SDK.9`, I can install the .NET 9 SDK.
55
57
56
58
## 5 - Use Dots the friendly .NET SDK manager
57
59
58
60
[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.
59
61
60
-
{.rounded-lg.mx-auto width=1000}
62
+
{.rounded-lg.mx-auto width="1000"}
61
63
62
64
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