IIS 7.5 and IIS 8.0 European Hosting

BLOG about IIS 7.5 Hosting, IIS 8.0 Hosting and Its Technology - Dedicated to European Windows Hosting Customer

IIS Hosting Europe - HostForLIFE :: How do you publish ASP.NET Core 9 on IIS (Internet Information Service)?

clock October 30, 2026 11:54 by author Peter

I'm assuming that you already have a pool on your Windows Server IIS when you read this post. To learn how to publish ASP.NET Core 9 apps on IIS environments, follow these steps. You must setup the project to operate on the architecture from the target pool and set up your code to support IIS.

 

Verify the inetmgr console, the Advanced option, and if Enable 32-Bit programs is set to true to determine whether your pool is operating on x86.

Let's do the steps to publish

Step 1. Start your new ASP.NET Core MVC
dotnet new mvc -n MyTestApp

Step 2. If you compile the application and start publishing, you face these default parameters

Step 3. I tried to publish it but got an error of 503. It's normal. This is what we will fix.
Step 4. Open the solution configuration, and choose New... from the Active solution platform.
Step 5. Choose your architecture pool. It should be the same as the pool on IIS (x86 for 32 bits).

Step 6. It will look like this.

Step 7. Back to the Publish configuration, you need to change this.

Step 8. But you will get the same error if you try to publish.

Step 9. To fix this, you need to configure your application to run under Windows, adding <TargetFramework>net9.0-windows</TargetFramework>, unload the project and edit it.
<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net9.0-windows</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <Platforms>AnyCPU;x86</Platforms>
  </PropertyGroup>
</Project>

Step 10. Now, if you open the Properties of your application, you will see that it is enabled to Target OS version 7.0.

Step 11. Now, you need to select the c: with "net8.0-windows":

Step 12. Before publishing a dotnet, copy the file app_offline.htm to the target IIS installation folder. This turns off the website so this message is displayed if you try to use it:

Step 13. Extra source code, Microsoft default source code. If the file name app_offline.htm indicates to dotnet that the execution should be terminated, it automatically redirects to it. You can customize this file as you like.
<!doctype html>
<title>Site Maintenance</title>
<style>
   body {
   text-align: center;
   padding: 150px;
   font: 20px Helvetica, sans-serif;
   color: #333;
   }
   h1 {
   font-size: 50px;
   }
   article {
   display: block;
   text-align: left;
   width: 650px;
   margin: 0 auto;
   }
   a {
   color: #dc8100;
   text-decoration: none;
   }
   a:hover {
   color: #333;
   text-decoration: none;
   }
</style>
<article>
   <h1>We’ll be back soon!</h1>
   <div>
      <p>Sorry for the inconvenience but we’re performing some maintenance at the moment. We’ll be back online shortly!</p>
   </div>
</article>


Step 14. You may face an error 503 yet, so add <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> to run OutOfProcess.
<Project Sdk="Microsoft.NET.Sdk.Web">
   <PropertyGroup>
      <TargetFramework>net9.0-windows</TargetFramework>
      <Nullable>enable</Nullable>
      <ImplicitUsings>enable</ImplicitUsings>
      <Platforms>AnyCPU;x86</Platforms>
      <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
   </PropertyGroup>
</Project>


Step 15. Copy the files, then delete the app_offline.htm file to run the application. This is the result.

Conclusion
There are a few steps, but it is essential to follow them to succeed in publishing ASP.NET Core 9 applications.



IIS Hosting Europe - HostForLIFE :: Automating IIS Upkeep: A Comprehensive Guide to 5-Hour Restarts

clock October 22, 2026 13:41 by author Peter

IIS (Internet Information Services) servers may occasionally experience memory leaks or stuck worker processes in high-traffic or older web setups. The server will stay responsive without human interaction if a periodic refresh is automated. This post offers a thorough tutorial on how to write a PowerShell maintenance script and use Windows Task Scheduler to schedule it.

Phase 1: Creating the PowerShell Script
The goal of the script is to refresh Application Pools and restart core services without requiring user interaction.
Create the Directory: Create a folder named C:\IISScripts\ to store your automation files.
The Script: Create a file named Restart-IIS.ps1 with the following content:
# Import the IIS Module
Import-Module WebAdministration

# 1. Recycle all Application Pools
# This clears memory for individual apps without stopping the whole server
Get-ChildItem IIS:\AppPools | ForEach-Object { Restart-WebAppPool -Name $_.Name }

# 2. Perform a full IIS Reset
# Restarts the W3SVC and other core services
iisreset /restart /timeout:20

# 3. Ensure all sites are started
# Restarts any sites that may have been manually stopped
Get-Website | Where-Object { $_.State -ne "Started" } | Start-Website


Note on Permissions: When testing this script manually in PowerShell ISE, you must right-click the program and select Run as Administrator. Failure to do so will result in "Access Denied" errors, even if your account has admin rights.

Phase 2: Configuring Task Scheduler
To run this every 5 hours automatically, use the Windows Task Scheduler with specific security settings to prevent "Logon Session" errors.

1. General Settings

  • Name: IIS 5-Hour Refresh.
  • Security Options: Click Change User or Group and set it to SYSTEM.
  • Privileges: Check Run with highest privileges.
  • Logon Options: Select Run whether user is logged on or not.

2. Triggers
Set the trigger to One time.
Under Advanced Settings, check Repeat task every: 5 hours.
Set duration to Indefinitely.

3. Actions

  • Action: Start a program.
  • Program/script: powershell.exe.
  • Add arguments: -ExecutionPolicy Bypass -File "C:\IISScripts\Restart-IIS.ps1".

Phase 3: Verification and Troubleshooting
Once configured, you should confirm the automation is working correctly:

  • Task Success: In the Task Scheduler Library, the Last Run Result should show 0x0.
  • System Logs: Open Event Viewer and navigate to Windows Logs > System. Look for a log entry with the source IIS-IISReset.
  • Common Error: If you see "A specified logon session does not exist," ensure the task is running under the SYSTEM account rather than a specific user account.

By following these steps, your IIS server will automatically refresh its resources every 5 hours, ensuring high availability and system stability.



IIS Hosting Europe - HostForLIFE :: Typical ASP.NET Core IIS Deployment Problems and Solutions

clock October 15, 2026 13:24 by author Peter

The process of deploying an ASP.NET Core application to IIS is often simple. However, error signals may frequently be deceptive when anything goes wrong. I just deployed a.NET 10 Web API on Windows Server 2022 and ran into a number of problems that first suggested a missing Hosting Bundle. After troubleshooting for several hours, I came to the conclusion that there might have been multiple setup problems rather than simply one.

In this article, I'll walk you through the exact troubleshooting process I followed. Whether you're facing HTTP Error 500.19, AspNetCoreModuleV2 errors, Hosting Bundle issues, or your application refuses to load after deployment, this guide will help you identify the root cause step by step.

For reference, here's the environment I was working with:

  • Windows Server 2022
  • IIS 10
  • ASP.NET Core .NET 10 Web API
  • SQL Server
  • Visual Studio 2022

The Initial Problem
After publishing my application to IIS, opening the website immediately displayed the following error:
HTTP Error 500.19 - Internal Server Error
Error Code: 0x8007000d

At first, it looked like IIS couldn't read the application's web.config file. In many cases, this error also appears when the ASP.NET Core Hosting Bundle is missing or IIS cannot load the ASP.NET Core Module.

Instead of reinstalling everything immediately, I decided to troubleshoot the problem systematically.

Step 1: Verify the web.config File

The first thing I checked was the web.config file generated during publishing.

For an ASP.NET Core application hosted in IIS, it should look similar to this:
<aspNetCore
    processPath="dotnet"
    arguments=".\YourApplication.dll"
    stdoutLogEnabled="true"
    stdoutLogFile=".\logs\stdout"
    hostingModel="InProcess" />

I carefully verified:

  • The DLL name matched the published application.
  • The XML structure was valid.
  • The hosting model was correct.
  • Stdout logging was enabled for troubleshooting.

Everything looked fine, so I moved to the next step.

Step 2: Check Whether the .NET Runtime Was Installed

The Hosting Bundle depends on the correct .NET runtime being installed.

To verify this, I opened Command Prompt and executed:
dotnet --list-runtimes

The output confirmed that both the ASP.NET Core Runtime and the .NET Runtime were installed.
Microsoft.AspNetCore.App 10.0.x
Microsoft.NETCore.App 10.0.x

If these runtimes are missing, your application will never start, regardless of IIS configuration.

Step 3: Verify the ASP.NET Core Hosting Bundle
Next, I checked whether the Hosting Bundle was installed.

Open:
Control Panel
→ Programs and Features


Look for something similar to:
Microsoft .NET 10.x Windows Server Hosting

If it isn't listed, download and install the correct Hosting Bundle for your .NET version from Microsoft.

If it is already installed, continue troubleshooting instead of reinstalling it immediately.

Step 4: Verify the ASP.NET Core Module

The Hosting Bundle installs the IIS module responsible for running ASP.NET Core applications.

Navigate to:
C:\Program Files\IIS\Asp.Net Core Module\V2

Make sure the following file exists:
aspnetcorev2.dll

If this file is missing, IIS won't be able to launch your application.

Step 5: Verify IIS Module Registration

Even if the DLL exists, IIS must register the module correctly.

Run the following command in PowerShell:
& "$env:windir\System32\inetsrv\appcmd.exe" list modules

Look for:
AspNetCoreModuleV2

If you don't see it, repairing or reinstalling the Hosting Bundle usually resolves the issue.

Step 6: Verify the Global Module Registration

Then verified that IIS had registered the module globally.

Open:
C:\Windows\System32\inetsrv\config\applicationHost.config

Search for:
<globalModules>

Inside the XML there will be section, you should find:

<add
    name="AspNetCoreModuleV2"
    image="%ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll" />


If this entry is missing, IIS cannot load ASP.NET Core applications.

Step 7: Verify the IIS Website
Sometimes the simplest things are overlooked.

I checked whether my website was actually running.
Import-Module WebAdministration
Get-Website


The website status should be:
Started


If the site is stopped, start it before continuing.

Step 8: Verify the Application Pool

This turned out to be one of the most important checks.

I opened the Application Pool settings and found:
Managed Runtime Version : v4.0

For ASP.NET Core applications, this setting is incorrect.

The Application Pool should be configured as:

  • .NET CLR Version: No Managed Code
  • Managed Pipeline: Integrated
  • Enable 32-Bit Applications: False

Although ASP.NET Core doesn't use the .NET Framework runtime inside IIS, many deployments are still configured incorrectly with v4.0, which often causes confusion.

Step 9: Verify IIS Bindings

Next, I confirmed that the website bindings were correct.

I verified:

  • HTTP binding
  • HTTPS binding
  • Host name
  • SSL certificate

An incorrect host name or missing SSL certificate can prevent requests from reaching your application.

Step 10: Run the Application Outside IIS

This was probably the most useful step during the entire troubleshooting process.

Instead of relying on IIS, I ran the application directly.
cd C:\inetpub\wwwroot\YourApplication
dotnet YourApplication.dll

The application started successfully.

Starting Application...
Application started successfully.

This immediately told me that the application itself was healthy and that the problem was somewhere in IIS rather than the application code.

Whenever you're troubleshooting deployment issues, this should be one of the first tests you perform.

Step 11: Enable Stdout Logging

If the application fails to start inside IIS, enable stdout logging temporarily.
stdoutLogEnabled="true"

After making a request, check the generated log files inside:
logs

These logs often contain the exact exception that caused the application to fail.

Remember to disable stdout logging once the issue has been resolved.

Step 12: Check Event Viewer

Windows Event Viewer provides valuable information when IIS fails to launch an application.

Navigate to:
Event Viewer
→ Windows Logs
→ Application

Look for errors related to:

  • IIS AspNetCore Module V2
  • IIS-W3SVC-WP
  • .NET Runtime

These events often reveal missing dependencies or startup exceptions.

Step 13: Test a Health Check Endpoint

Instead of opening the root URL, I tested my Health Check endpoint.
https://yourdomain.com/health

The response was:
Healthy

This single response confirmed that:

  • IIS was working correctly.
  • The Hosting Bundle was installed correctly.
  • ASP.NET Core Module was working.
  • HTTPS was configured properly.
  • The application had started successfully.

Health Check endpoints are extremely useful when validating deployments.

Step 14: Test the Application with cURL or PowerShell

You can also verify your deployment without opening a browser.

Using Command Prompt:
curl https://yourdomain.com/health

Or PowerShell:
Invoke-WebRequest https://yourdomain.com/health

Receiving a 200 OK response confirms that IIS is successfully forwarding requests to your application.

Step 15: Verify Swagger Configuration

One thing that often confuses developers is Swagger returning a 404 Not Found error.

In my case, Swagger was only enabled for Development and Staging environments.
if (app.Environment.IsDevelopment() || app.Environment.IsStaging())
{
    app.UseSwagger();
    app.UseSwaggerUI();
}


When deployed to Production, /swagger naturally returned 404.

This wasn't a deployment problem it was simply how the application was configured.

Step 16: Verify the Root Endpoint
Another thing I discovered was that visiting the root URL returned 404 Not Found.

Initially, I thought the deployment had failed.

However, after reviewing my application, I realized I hadn't mapped an endpoint for /.

My application only exposed:

  • Controllers
  • Health Checks
  • SignalR Hub

Since there was no route for /, ASP.NET Core correctly returned 404.

Adding a simple root endpoint solved this.
app.MapGet("/", () =>
{
    return Results.Ok(new
    {
        Application = "My API",
        Status = "Running"
    });
});


Step 17: Verify the Published Files
Before blaming IIS, make sure the publish folder contains all required files.
A standard ASP.NET Core publish output should include:

  • Application DLL
  • .deps.json
  • .runtimeconfig.json
  • web.config
  • appsettings.json

Missing files can prevent the application from starting correctly.

Step 18: Verify Database Connectivity
Many applications execute database migrations or seed data during startup.
If the SQL Server is unavailable, the connection string is incorrect, or the credentials are invalid, the application may fail before it even starts serving requests.

Always verify your database connectivity as part of deployment troubleshooting.

Complete Troubleshooting Checklist

Before concluding that the Hosting Bundle is the problem, verify the following:

CheckStatus

IIS Website Started

success

Application Pool Started

success

Application Pool uses No Managed Code

success

.NET Runtime Installed

success

ASP.NET Core Hosting Bundle Installed

success

AspNetCoreModuleV2 Installed

success

IIS Global Module Registered

success

web.config Valid

success

Published Files Complete

success

Application Starts with dotnet YourApplication.dll

success

Stdout Logs Checked

success

Event Viewer Checked

success

Database Connectivity Verified

success

Health Endpoint Working

success

HTTPS Binding Verified

success

SSL Certificate Valid

success

The biggest lesson I learned was not to jump straight to reinstalling the Hosting Bundle.

A deployment issue can originate from several different layers, including:

  • Missing .NET Runtime
  • Missing Hosting Bundle
  • Unregistered ASP.NET Core Module
  • Incorrect Application Pool configuration
  • Invalid IIS bindings
  • Startup exceptions
  • Database connection failures
  • Missing published files
  • Environment-specific configuration
  • Missing application routes

By troubleshooting each layer one at a time, it's much easier to identify the real cause without making unnecessary changes.

Conclusion

Deploying ASP.NET Core applications to IIS doesn't have to be frustrating. Most deployment failures can be resolved by following a structured troubleshooting process rather than guessing or repeatedly reinstalling software. I hope this guide saves you time the next time you encounter an IIS deployment issue. If you're deploying ASP.NET Core applications regularly, consider bookmarking this checklist, it's a practical reference that can help diagnose almost every common IIS deployment problem before it becomes a lengthy debugging session.



IIS Hosting Europe - HostForLIFE :: How To Deploy React Application On IIS Server?

clock October 6, 2026 13:02 by author Peter

Today, I am going to show you how to deploy the React App to the IIS server, so let's grab a cup of coffee and start coding.

What is IIS?
IIS stands for "Internet Information Services", which is a web server provided by Microsoft to host the websites and other stuff on the web.

How to enable IIS?
If you have already enabled IIS then you can skip this step. But if you have not enabled it already then follow the below steps:

  • Open Control Panel and then click on the "Programs and Features".
  • Click on "Turn Windows features on or off".
  • Select Internet Information Services and click on the OK button.
  • To see whether or not IIS is enabled, press Windows + R key and type inetmgr and click on OK.
  • IIS Manager is open.

Create a Simple React App
Open a command prompt or your favorite terminal and type the below command to create a react app.
    npx create-react-app my-react-app

After successfully creating the app go to the new app.
    cd my-react-app

To see how it look likes type the below command.
    npm start

and it will start the development server and navigate you to http://localhost:3000/

You can see the default landing page: 

To host an app in any web server we first need to create a production build. To create a production build of our react app use the below command.
    npm run build

The output of the above command creates a new build folder inside the project which contains production build. So far we have created a React app & created a production build of that app. Now the next step is to deploy it on IIS. Press Windows + R key and write inetmgr to open the IIS Manager. You can see the below screen.

First, we will create a new Application Pool, so right-click on Application Pools and click on Add Application Pool. Then give it a name as you want and click on OK button.
After that right-click on the new app pool and select Advanced Settings. You will see the below window.

Then click on Identity and choose a Custom account and click on the set button and then add your windows credentials and click on OK.
After that right-click on Sites and then click on Add Website. Add the Site name and select application pool which we created earlier. After that under the physical path section, you have to give the path of build folder & also give the port number where you want to host.

Now right click on new website i.e ReactApp -> Manage Website -> Browse. Your react app is now successfully deployed.


Now the next step is to add routing in our react application. So I have created 2 components and also added react-router-dom package for routing. Here we are not going into detail about react routing.

Home page

Blog page

Create a production build again and try to browse the application which we hosted on IIS. You will see the application is working fine but now try to refresh the page and see what happens. You will get the below error.

So to fix this issue you have to install URL Rewrite module. After successful installation, you have to create a web.config file under public folder of app and copy-paste the below content into it.
    <?xml version="1.0"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="React Routes" stopProcessing="true">
    <match url=".*" />
    <conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
    </conditions>
    <action type="Rewrite" url="/" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

Again build the application in production mode and browse. So now if you refresh the app you will not get an error and will be able to see the correct page. That's it -- so you have successfully created and deployed React application into the IIS server.

Conclusion
I hope that you have enjoyed this article, and please do not hesitate to send me your thoughts or comments about what could I have done better.



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in