Skip to main content

Install IIS menggunakan .Net Core

Berikut ini adalah ✅ Checklist Minimum Instalasi IIS + Pendukung ASP.NET Core 8.0 di Windows Server 2016:


A. Checklist Role & Features IIS (Minimal untuk ASP.NET Core 8.0)

Saat menggunakan Add Roles and Features di Server Manager, pastikan kamu centang yang berikut:

1. Web Server (IIS)

  • ✅ Web Server

    • ✅ Common HTTP Features

      • ✅ Static Content

      • ✅ Default Document

      • ✅ HTTP Errors

    • ✅ Application Development

      • (Optional) .NET Extensibility 4.6 (boleh di-skip)

      • (Optional) ASP.NET 4.6 (boleh di-skip)

      • ✅ ISAPI Extensions

      • ✅ ISAPI Filters

      • ✅ WebSocket Protocol (jika pakai SignalR/WebSocket)

    • ✅ Health and Diagnostics

      • ✅ HTTP Logging

      • ✅ Request Monitor (opsional)

    • ✅ Performance Features

      • ✅ Static Content Compression (opsional tapi direkomendasikan)

    • ✅ Security

      • ✅ Request Filtering

      • ✅ Windows Authentication (jika kamu pakai auth Windows)

    • ✅ Management Tools

      • ✅ IIS Management Console

2. (Opsional) .NET Framework 4.6 Features

Tidak wajib untuk ASP.NET Core 8.0. Centang hanya jika kamu juga ingin menjalankan aplikasi .NET Framework 4.x.


B. Install .NET 8 Hosting Bundle

Ini WAJIB agar ASP.NET Core 8.0 bisa dijalankan melalui IIS.

  1. Download dari:
    https://dotnet.microsoft.com/en-us/download/dotnet/8.0
    Pilih: ASP.NET Core Runtime - Hosting Bundle

  2. Jalankan installer sebagai Administrator

  3. Setelah selesai, restart server

  4. Verifikasi di PowerShell:

dotnet --info

C. Konfigurasi IIS (Pasca Install)

  1. Buat folder publish di C:\inetpub\wwwroot\MyApp

  2. Copy hasil dotnet publish ke sana

  3. Di IIS Manager:

    • Klik kanan pada Sites > Add Website

    • Isi:

      • Site name: MyApp

      • Physical path: C:\inetpub\wwwroot\MyApp

      • Binding: HTTP, port 5000 atau 80

  4. Pastikan:

    • Application Pool pakai:

      • .NET CLR Version: No Managed Code

      • Mode: Integrated


D. Web.config Minimal untuk ASP.NET Core

Contoh web.config di folder publish:

<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments="MyApp.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
  </system.webServer>
</configuration>

E. Tambahan (Opsional tapi Disarankan)

FiturTujuan
Static Content CompressionPerforma
WebSocket ProtocolJika pakai SignalR
Windows AuthenticationJika pakai auth intranet
Failed Request TracingDebugging