Installing .NET SDK
Brief Overview
Section titled “Brief Overview”The .NET SDK is a required dependency for running Hagicode. After installation, you can use Hagicode.
Installing .NET SDK
Section titled “Installing .NET SDK”Method One: Official Installer (Recommended)
Section titled “Method One: Official Installer (Recommended)”- Visit the .NET Official Website
- Select .NET 10 version
- Download the SDK (not Runtime) Windows installer (
.exeor.msifile) - Double-click to run the installer
- Follow the installation wizard prompts to complete installation:
- Accept the license agreement
- Choose installation path (default is fine)
- Click “Install” to start installation
- After installation completes, click “Close”
Method Two: Using winget
Section titled “Method Two: Using winget”Open PowerShell or Command Prompt and run:
winget install Microsoft.DotNet.SDK.10Method Three: Using Chocolatey
Section titled “Method Three: Using Chocolatey”If you already have Chocolatey installed:
choco install dotnet-10-sdkMethod One: Official Installer (Recommended)
Section titled “Method One: Official Installer (Recommended)”- Visit the .NET Official Website
- Select .NET 10 version
- Download the SDK macOS installer (
.pkgfile) - Double-click to run the installer
- Follow the installation wizard prompts to complete installation:
- Click “Continue”
- Accept the license agreement
- Choose installation disk
- Click “Install” and enter administrator password
- After installation completes, click “Close”
Method Two: Using Homebrew
Section titled “Method Two: Using Homebrew”If you have Homebrew installed, you can install .NET SDK via terminal:
# Add Microsoft tapbrew tap microsoft/dotnet
# Install .NET 10 SDKbrew install dotnet-sdk-10Method Three: Using .NET Install Script
Section titled “Method Three: Using .NET Install Script”# Download and run the installation scriptcurl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 10.0
# Add .NET to PATH (add to ~/.zshrc or ~/.bashrc)export DOTNET_ROOT=$HOME/.dotnetexport PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/toolsUsing Microsoft Package Repository (Recommended)
Section titled “Using Microsoft Package Repository (Recommended)”This is the best way to get the latest .NET SDK version:
# Add Microsoft package repositorywget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.debsudo dpkg -i packages-microsoft-prod.debrm packages-microsoft-prod.deb
# Update package listsudo apt-get update
# Install .NET 10 SDKsudo apt-get install -y dotnet-sdk-10.0Using apt Package Manager
Section titled “Using apt Package Manager”The default repository for Ubuntu 24.04+ may contain .NET 10 SDK:
sudo apt-get updatesudo apt-get install -y dotnet-sdk-10.0Using Snap
Section titled “Using Snap”Ubuntu also supports installation via Snap:
sudo snap install dotnet-sdk --classic --channel=10Using Microsoft Package Repository (Recommended)
Section titled “Using Microsoft Package Repository (Recommended)”# Add Microsoft package repositorysudo rpm -Uvh https://packages.microsoft.com/config/centos/$(rpm -E %{rhel})/packages-microsoft-prod.rpm
# Update package listsudo yum update
# Install .NET 10 SDKsudo yum install -y dotnet-sdk-10.0Using yum Package Manager
Section titled “Using yum Package Manager”sudo yum install -y dotnet-sdk-10.0Using dnf Package Manager
Section titled “Using dnf Package Manager”# Add Microsoft package repositorysudo rpm -Uvh https://packages.microsoft.com/config/fedora/$(rpm -E %fedora)/packages-microsoft-prod.rpm
# Update package listsudo dnf update
# Install .NET 10 SDKsudo dnf install -y dotnet-sdk-10.0Using pacman Package Manager
Section titled “Using pacman Package Manager”# Install .NET 10 SDKsudo pacman -S dotnet-sdk-10.0Verifying Installation
Section titled “Verifying Installation”After installation, verify that .NET SDK is installed correctly:
# Check .NET SDK versiondotnet --version
# View detailed SDK informationdotnet --infoTroubleshooting
Section titled “Troubleshooting”Windows
Section titled “Windows”If the dotnet command is not available after installation:
- Restart Command Prompt or PowerShell
- If still not available, manually add .NET to PATH:
- Search for “Environment Variables” and open “Edit system environment variables”
- Click “Environment Variables”
- Find “Path” in “System variables” and click “Edit”
- Add the .NET SDK installation path (default:
C:\Program Files\dotnet\) - Click “OK” to save changes
If the command is not available after installation:
- Restart Terminal
- If installed via Homebrew, run:
Terminal window eval "$(/opt/homebrew/bin/brew shellenv)" - Manually add to PATH (in
~/.zshrcor~/.bash_profile):Terminal window export DOTNET_ROOT=$HOME/.dotnetexport PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
If you encounter permission errors when running dotnet:
# Ensure the installation path is executablesudo chmod +x $HOME/.dotnet/dotnet
# If installed via system package manager, reinstallsudo apt-get install --reinstall dotnet-sdk-10.0Acceleration for Mainland China Users
Section titled “Acceleration for Mainland China Users”If download speeds are slow, you can use the following mirror sources:
- Azure China Mirror: https://dotnetcli.azureedge.net/dotnet/
- Official CDN: https://dotnetcli.blob.core.windows.net/
Visit the above addresses and select the version you need to download.
Appendix: Uninstalling .NET SDK
Section titled “Appendix: Uninstalling .NET SDK”If you need to uninstall .NET SDK:
- Open “Control Panel” > “Programs and Features”
- Find “Microsoft .NET SDK - 10.0.0”
- Right-click and select “Uninstall”
Or use command line:
# Uninstall via wingetwinget uninstall Microsoft.DotNet.SDK.10
# Uninstall via Chocolateychoco uninstall dotnet-10-sdk# If installed via Homebrewbrew uninstall dotnet-sdk-10
# If installed via installersudo rm -rf /usr/local/share/dotnetsudo rm -rf /usr/local/bin/dotnet# Ubuntu/Debiansudo apt-get remove dotnet-sdk-10.0sudo apt-get autoremove
# CentOS/RHELsudo yum remove dotnet-sdk-10.0
# Fedorasudo dnf remove dotnet-sdk-10.0
# If installed via install scriptrm -rf ~/.dotnet