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 :: ASP.NET Core 9 Application Deployment on IIS

clock June 26, 2025 09:24 by author Peter

I assume that you already have a pool on your Windows Server IIS system before reading this post. 

To learn how to publish ASP.NET Core 9 applications on IIS environments, follow these steps. You must configure the project to run on the architecture from the target pool and set up your code to support IIS. Verify the inetmgr console, check the Advanced setting, and see if Enable 32-Bit programs is set to true to see if 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&rsquo;ll be back soon!</h1>
   <div>
      <p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. We&rsquo;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.



IIS Hosting Europe - HostForLIFE :: Respond to IIS Requests in ASP.NET

clock June 19, 2025 09:36 by author Peter

Type our application url (.aspx) in browser and press enter, then what will happen?


We will get the response in terms of html, but how it is possible? 
First request goes to the web server and it will check which ISAPI extension is requesting to server. In the case of .aspx, request goes  to aspnet_isapi.dll for processing our application.

Then it will check if request is coming first time or not. If request is coming for the first time, then application manager will create application domain where application runs. ASP.NET created objects like HttpContext, HttpRequest, HttpResponse.

Then application is started by creating the object of HttpApplication class.

Then HttpApplication class starts processing the request.

First global.asax page will fire, according to page life cycle events on page will be fired:

the request process is as-: 



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