Publish ASP.NET Core to IIS

The 500.30 error that ruins deployments. Fix it forever. 6 mins.

Your First "Aha" Moment: IIS doesn't run.NET code. It just forwards requests to your app running as a separate process.

1. How IIS + ASP.NET Core Actually Works

Old ASP.NET: IIS loaded your DLL inside w3wp.exe.
ASP.NET Core: IIS uses AspNetCoreModuleV2 as a reverse proxy. Your app runs in dotnet.exe. IIS just passes traffic.

โŒ 500.30 ANCM In-Process Start Failure

Cause: App crashed before it started.
90% Reason: Wrong.NET runtime, missing web.config, or bad connection string.

โœ… Check 3 Things First

1. dotnet --info on server. Runtime installed?
2. Event Viewer โ†’ Windows Logs โ†’ Application
3. stdoutLogEnabled="true" in web.config

2. Publish in 4 Steps - No Fails

Step 1: Install Hosting Bundle
Server โ†’ Download ".NET Core Hosting Bundle" for your version. This installs runtime + AspNetCoreModuleV2. Reboot IIS: iisreset.

Step 2: Publish from VS
Right-click project โ†’ Publish โ†’ Folder โ†’ Target: Framework-dependent, Deployment: win-x64. This creates web.config automatically.

Step 3: IIS Setup
1. Copy publish folder to C:\inetpub\wwwroot\MyApp
2. IIS โ†’ Add Website โ†’ Physical path = your folder.
3. Application Pool โ†’.NET CLR Version = No Managed Code. Yes, really.

Step 4: Fix Permissions
Folder โ†’ Security โ†’ Give IIS AppPool\MyApp Read+Execute. Give IUSR Read.
If writing files/logs: AppPool needs Write on that folder.

Career-Killer Mistake #1: Setting App Pool to .NET CLR v4.0.
What happens: IIS tries to load your app with CLR. Fails instantly. 500.19 or 500.30.
Fix: ASP.NET Core runs out-of-process. Always No Managed Code.

Quick Check ๐Ÿง 

Next: Azure IIS is legacy. Deploy to Azure App Service teaches CI/CD, slots, and why companies pay 10x for cloud. Let's go โ†’

Comments on Publish to IIS (0)

No comments yet. Be the first to share your thoughts!