Module 4: IIS Hosting

Deploying and hosting applications on IIS.

Duration: 60 minutes

Learning Objectives

  • • Configure IIS for ASP.NET Core applications
  • • Deploy applications to IIS server
  • • Optimize application performance
  • • Troubleshoot common deployment issues

Key Topics

IIS Configuration and Setup

Installing and configuring IIS for hosting ASP.NET Core applications.

# Install IIS and ASP.NET Core Hosting Bundle
# Enable required Windows features
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServer
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CommonHttpFeatures

Application Deployment

Publishing and deploying applications to IIS server.

# Publish application
dotnet publish -c Release -o ./publish

# Copy files to IIS directory
# Configure application pool
# Set up virtual directory

Performance Optimization

Optimizing IIS settings for better application performance.

# web.config optimization
<system.webServer>
  <httpCompression>
    <dynamicTypes>
      <add mimeType="application/json" enabled="true" />
    </dynamicTypes>
  </httpCompression>
  <caching>
    <profiles>
      <add extension=".css" policy="CacheUntilChange" />
    </profiles>
  </caching>
</system.webServer>

Troubleshooting Common Issues

Identifying and resolving common deployment problems.

  • • Check application pool settings
  • • Verify .NET Core runtime installation
  • • Review IIS logs for errors
  • • Ensure proper file permissions
  • • Check firewall and port configurations

Hands-on Exercises

Exercise 1: Deploy Student Management App

Deploy the ASP.NET Core application from Module 3 to IIS.

Exercise 2: Performance Tuning

Optimize IIS settings for better application performance.

Exercise 3: Troubleshooting Scenario

Identify and fix common deployment issues in a simulated environment.