How to Deploy a Blazor Application on IIS

How to Deploy a Blazor Application on IIS

Blazor is a web framework for simplifying the development of fast single page applications, which can run in any browser. It is based on C#, Razor, and HTML.

In this article, you will learn to deploy an ASP.NET Core hosted application created with the web UI framework on IIS. You will use Visual Studio 2017 on your Windows 10 PC to publish it. You will also use SQL Server 2014 to deal with DB operations. But before discussing the steps for deployment, let’s take a look at the prerequisites.

Prerequisites

Also, take a look at this article, which shows the process of creating Cascading DropDownList in Blazor using Entity framework. You will have to take it as a reference for developing the application that will be deployed in this tutorial.

Steps for Installing .NET Core Hosting Bundle

First, you need to install .NET Core Hosting Bundle. Follow these steps:

  1. Head to the .NET Core Hosting Bundle
  2. Choose the latest non-preview .NET Core runtime.

How to Deploy a Blazor Application on IIS

  1. Click on Hosting Bundle Installer. The .NET Core Hosting Bundle will begin to be downloaded.

How to Deploy a Blazor Application on IIS

  1. Double click on the downloaded file to start the installation process.

When the installation is done, restart your PC.

Steps for Publishing the Blazor Application

Now, it’s time for publishing your Blazor application. Here are the steps:

  1. Open Visual Studio 2017.
  2. Open the Blazor application.
  3. Take a look at the Solution Explorer tab, which is located on the left side of the screen. Right-click on Server project of the solution, which is BlazorDDL.Server. Click on Publish.

How to Deploy a Blazor Application on IIS

  1. You will see a new screen. In the left menu, click on Folder. Choose the folder where you want your Blazor application to be published to.

How to Deploy a Blazor Application on IIS

  1. Click on Publish. If there is no error, your application will be published successfully.

Steps for Configuring IIS

Next, you will have to configure IIS. Follow these steps:

  1. Open IIS
  2. Right click on Sites. Then click on Add Website
  3. A pop-up box will appear. Enter your Site name. In this tutorial, we will use ankitsite. Insert the path to the published application in the box below Physical path. Then insert your Hostname. Here, we will use ankitsite.com

How to Deploy a Blazor Application on IIS

  1. Click OK.
  2. Now, you have to configure Application Pool. You will find it the left panel. Double click on the pool ankisite, which is the same as the Site name you entered in the 3rd step.
  3. The Edit Application Pool window will appear. From the .NET CLR Version drop-down list, choose No Managed Code option.

  1. Click OK.

Steps for Configuring the DNS Host

The process of configuring the DNS Host is really easy. You just need to follow these steps:

  1. Head to this path on your PC:
C:WindowsSystem32driversetc
  1. Open the hosts file with your favorite text editor.
  2. Add the hostname, which you entered in the 3rd step of Configuring IIS section, against the local IP address.

Steps for Executing Demo

Finally, it’s time for executing your Blazor application on localhost. Here are the steps:

  1. Open your favorite browser.
  2. Enter the configured hostname in the address bar.
  3. Hit the Enter button. Your Blazor application will appear.

Conclusion

In this article, you have learned to publish your Blazor application. You have also learned to configure IIS and DNS host appropriately.

Check out these top 3 Windows hosting services:

Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
InterServer
$2.50 /mo
Starting price
Visit InterServer
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.5
  • Features
    4.8
  • Reliability
    4.9
  • Pricing
    4.3

How To Harden a Windows IIS Web Server

The article covers how to improve security in Windows Internet Information servi
3 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Install the WISA (Windows, IIS, SQL, ASP.NET) Stack

WISA is an acronym which stands for (Windows, IIS, SQL, and ASP.net).WISA uses W
3 min read
Vladimir Rakov
Vladimir Rakov
Hosting Expert

How To Disable The Vulnerability of Options Method in IIS and Apache

OPTIONS offer a potential attacker a loophole that serves as a shortcut to anot
3 min read
Craig Timmins
Hosting Expert

How to Set Up IIS Application Pool (Windows) in Plesk

IIS Application Pool contains all web applications installed on your sites. You
2 min read
Elizabeth Njoroge
Elizabeth Njoroge
Author
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top