Cara memeriksa apakah .NET sudah diinstal
Artikel ini mengajarkan Anda cara memeriksa versi runtime .NET dan SDK mana yang diinstal di komputer Anda. Jika Anda memiliki lingkungan pengembangan terintegrasi, seperti Visual Studio, .NET mungkin telah diinstal.
Menginstal SDK menginstal runtime yang sesuai.
Jika ada perintah dalam artikel ini yang gagal, Anda tidak memiliki runtime atau SDK yang terinstal. Untuk informasi selengkapnya, lihat artikel penginstalan untuk Windows, macOS, atau Linux.
Memeriksa versi SDK
Anda dapat melihat versi .NET SDK mana yang saat ini diinstal dengan terminal. Buka terminal dan jalankan perintah berikut.
dotnet --list-sdks
Anda mendapatkan output yang mirip dengan yang berikut ini.
3.1.424 [C:\program files\dotnet\sdk]
5.0.100 [C:\program files\dotnet\sdk]
6.0.402 [C:\program files\dotnet\sdk]
7.0.404 [C:\program files\dotnet\sdk]
8.0.100 [C:\program files\dotnet\sdk]
3.1.424 [/home/user/dotnet/sdk]
5.0.100 [/home/user/dotnet/sdk]
6.0.402 [/home/user/dotnet/sdk]
7.0.404 [/home/user/dotnet/sdk]
8.0.100 [/home/user/dotnet/sdk]
3.1.424 [/usr/local/share/dotnet/sdk]
5.0.100 [/usr/local/share/dotnet/sdk]
6.0.402 [/usr/local/share/dotnet/sdk]
7.0.404 [/usr/local/share/dotnet/sdk]
8.0.100 [/usr/local/share/dotnet/sdk]
Memeriksa versi runtime
Anda dapat melihat versi runtime .NET mana yang saat ini diinstal dengan perintah berikut.
dotnet --list-runtimes
Anda mendapatkan output yang mirip dengan yang berikut ini.
Microsoft.AspNetCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.30 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.AspNetCore.All 2.1.7 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.7 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.7 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Microsoft.AspNetCore.All 2.1.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Periksa folder penginstalan
Ada kemungkinan bahwa .NET diinstal tetapi tidak ditambahkan ke PATH
variabel untuk sistem operasi atau profil pengguna Anda. Dalam hal ini, perintah dari bagian sebelumnya mungkin tidak berfungsi. Sebagai alternatif, Anda dapat memeriksa apakah folder penginstalan .NET ada.
Saat Anda menginstal .NET dari alat penginstal atau skrip, itu diinstal ke folder standar. Sebagian besar waktu alat penginstal atau skrip yang Anda gunakan untuk menginstal .NET memberi Anda opsi untuk menginstal ke folder yang berbeda. Jika Anda memilih untuk menginstal ke folder lain, sesuaikan awal jalur folder.
dotnet executable
C:\program files\dotnet\dotnet.exe.NET SDK
C:\program files\dotnet\sdk\{version}\.NET Runtime
C:\program files\dotnet\shared\{runtime-type}\{version}\
dotnet executable
/home/user/.dotnet/dotnet
/usr/lib/dotnet/dotnet
/usr/share/dotnet/dotnet\.NET SDK
/home/user/.dotnet/sdk/{version}/
/usr/lib/dotnet/sdk/{version}/
/usr/share/dotnet/sdk/{version}/\.NET Runtime
/home/user/.dotnet/shared/{runtime-type}/{version}/
/usr/lib/dotnet/shared/{runtime-type}/{version}/
/usr/share/dotnet/shared/{runtime-type}/{version}/\
dotnet executable
/usr/local/share/dotnet/dotnet.NET SDK
/usr/local/share/dotnet/sdk/{version}/.NET Runtime
/usr/local/share/dotnet/shared/{runtime-type}/{version}/
Informasi selengkapnya
Anda dapat melihat versi SDK dan versi runtime dengan perintah dotnet --info
. Anda juga akan mendapatkan informasi terkait lingkungan lainnya, seperti versi sistem operasi dan pengidentifikasi runtime (RID).
Langkah berikutnya
- Instal .NET Runtime dan SDK untuk Windows.
- Instal .NET Runtime dan SDK untuk macOS.
- Instal .NET Runtime dan SDK untuk Linux.