Host asp net core app in iis to access from other pcs inside the network

ASP.NET is a popular programming used for developing web applications. One common requirement is to host an ASP.NET Core app in IIS (Internet Information ) so that it can be accessed from other computers within the same network. In this article, we will explore the steps to achieve this and provide examples along the way.

Step 1: Install IIS

To begin, we need to that IIS is installed on the machine where we want to host our ASP.NET Core app. Follow steps to install IIS:


1. Open the  Panel on your machine.
2.  on "Programs" or "Programs and Features."
3. Select "Turn Windows features on or off."
4. Scroll down and locate "Internet Information Services."
5. Expand the node and check the box next to "Web Management Tools" and " Wide Web Services."
6. Click "OK" to install IIS.

Step 2: Publish the ASP.NET Core App

Next, we need to publish our ASP.NET Core app so that it can be hosted in IIS. Follow these steps to publish the app:


1. Open the command prompt or terminal.
2.  to the root directory of your ASP.NET Core app.
3. Run the command "dotnet publish -c Release -o " to publish the app.

Replace “” with the path where you want to publish the app.

Step 3: Create an IIS Site

Now, we need to create an IIS site to host our ASP.NET Core app. Follow these steps to create the site:


1. Open the Internet Information Services (IIS) Manager.
2. Expand the server node and right-click on "Sites."
3. Select "Add " from the context menu.
4. Provide a name for the site and specify the  path to the published app.
5. Set the binding information, such as the IP address and port number.
6. Click "OK" to create the site.

Step 4: Configure Firewall

In order to access the ASP.NET Core app from other computers within the network, we need to configure the firewall to allow incoming connections on the specified port. Follow these steps to configure the firewall:


1. Open the Control Panel on your machine.
2. Click on "System and Security" or "Windows Security."
3. Select "Windows Defender Firewall."
4. Click on "Advanced settings" on the left-hand side.
5. In the "Inbound Rules" section, click on "New Rule."
6. Select "Port" and click "Next."
7. Specify the port number used by the ASP.NET Core app and click "Next."
8. Select "Allow the connection" and click "Next."
9. Choose the network location where this rule should apply and click "Next."
10. Provide a name for the rule and click "Finish."

Step 5: Access the App from Other PCs

Once the above steps are completed, you should be able to access the ASP.NET Core app from other computers within the network. Open a web browser on another PC and enter the IP address or hostname of the machine hosting the app, followed by the port number and the site name (if applicable).


http://:/

Replace “” with the actual IP address or hostname of the machine hosting the app, “” with the port number specified in the binding information, and “” with the name of the site (if applicable).

By following these steps, you should now be able to host your ASP.NET Core app in IIS and access it from other computers within the network. This allows for easy sharing and testing of your web application across multiple devices.

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents