Back to Devexpress

Deploy a XAF ASP.NET Core Application (Blazor Server, Middle Tier Server, or Web API Service) to IIS

expressappframework-404613-deployment-asp-net-core-blazor-deploy-net-core-application-to-iis.md

latest6.4 KB
Original Source

Deploy a XAF ASP.NET Core Application (Blazor Server, Middle Tier Server, or Web API Service) to IIS

  • Feb 16, 2026
  • 5 minutes to read

This topic explains how to set up and publish an XAF Blazor Server application to an IIS server using the MS SQL database provider. For more information about other deployment approaches for ASP.NET Core and Blazor applications, refer to the Microsoft documentation.

Prerequisites

  • A Windows Server that is configured with the Web Server (IIS) server role and has MS SQL Server installed.

  • An XAF ASP.NET Core application. This topic is based on the MainDemo Blazor Server demo application that ships with XAF. You can find this demo in the following folder: %PUBLIC%\Documents\DevExpress Demos 25.2\Components\XAF\MainDemo.NET.EFCore\CS\MainDemo.Blazor.Server.

Deployment Instructions

Install the .NET Core Hosting Bundle

Install the .NET Core Hosting Bundle on an IIS server. The bundle includes .NET Core Runtime, .NET Core Library, and ASP.NET Core Module. These features enable you to run ASP.NET Core apps with IIS. You can download the installer from the following page: Download the .NET Core Hosting Bundle installer.

Create an IIS Site

  1. Enable IIS in Windows Features.

  2. Enable WebSockets in IIS for deploying Blazor Server or Middle Tier applications.

  3. Create a folder that should contain files of a published app (for example, c:\inetpub\wwwroot\maindemo).

  4. Launch Internet Information Services (IIS) Manager. Right-click Sites and select Add Website.

  5. In the Add Website dialog that appears, specify field values and click OK.

Set Up a Connection String

  1. Run Visual Studio with administrative privileges and open your Blazor project (the MainDemo Blazor Server demo application is used in this example).

  2. Specify a connection string in the appsettings.json file. For example, you can use the following connection string for MSSQL Server (replace YourServerName with the correct value):

  3. Build your solution and make sure that the application runs correctly in development mode.

  4. You may see the following error: The certificate chain was issued by an authority that is not trusted. In this case, install a valid CA-signed SSL/TLS certificate on your SQL Server. For testing purposes, you can add a TrustServerCertificate=True; option to your connection string (replace YourServerName with the correct value):

Publish the Application

  1. In Solution Explorer , right-click the project name and click Publish.

  2. Select Folder and click Next.

  3. In the Folder location box, specify a folder you have created (c:\inetpub\wwroot\maindemo) and click Finish.

  4. Close the Publish wizard.

  5. Visual Studio creates a publishing profile for your project.

  6. Click Publish next to the created profile.

  7. The Publish page with a successful result indicates that the application has been published correctly.

  8. Launch the Command Prompt and update a database.

Add IIS AppPool Identities as SQL Server Logons

  1. Launch Microsoft SQL Server Management Studio.

  2. Connect to your server and create a new login. For this purpose, right-click the Security | Logins node in Object Explorer and select New Login from the ensuing context menu.

  3. The Login - New dialog appears. On its General page, specify the login name (IIS APPPOOL\maindemo).

  4. On the Server Roles page, select roles for the created login. For example, you can check public and svsadmin boxes.

  5. On the User Mapping page, select your database and set up mappings for it.

  6. On the Securables page, click Search and add your SQL Server instance to the page.

  7. Grant the Connect SQL permission to the added server and save the login.

Run the Published Application

  1. Launch Internet Information Services (IIS) Manager. Expand the Sites node to ensure that the published application is running.

  2. Click Browse to open the application in your browser.

  3. The application runs in your default browser.

Important Disclaimer

These deployment recommendations do not apply to all possible configurations and should not be considered comprehensive. We offer these instructions as a getting-started reference. Steps may vary depending on your operating system, installed software, and DevExpress versions. You, the developer, are responsible for the application, database, network, and other configurations based on your client, security, environment, and other requirements. We recommend that you review these settings with your database, network, and IT infrastructure administrators and consider their recommendations tailored to your case. We also recommend that you review Performance Optimization tips for deployed applications.

Troubleshooting

If you encounter problems, refer to the Deployment Troubleshooting Guide or explore logs and stack traces in Event Viewer.

Additional Resources

Refer to the Microsoft documentation for more information about deploying ASP.NET Core and Blazor applications: