9601. Deploying ASP.NET MVC Application to IIS
IIS and ASP.NET


Deploy ASP.NET application to local IIS web server.

There are totally 4 steps:

  • Install required components in IIS.
  • Publish files to IIS: copy files to server and create website in IIS.
  • Add Port Exception to Windows Firewall.
  • Assign public IP Address to your website.

1. Installing required components in IIS

Control Panel-> Programs and Features
image1
Select IIS(Internet Information Services)
image2

2. Publishing files to IIS

2.1 Starting to Publish

In Visual Studio, select project - > Publish…
image3

2.2 Creating a new profile

image4

2.3 Connection

Configure server and website. Here we choose the default website.
image5

2.4 Settings

Choose ‘Release’.
image6

2.5 Preview

Check what files are to be deployed. Click ‘Publish’ button if no issue. image7
Your web browser will be opened automatically to access your website.
image9

2.6 Files in IIS After Publish

All of files for the published website are copied to ‘C:\inetpub\wwwroot\CoursePlayer’.
image8

3. Adding Port Exception to Firewall

3.1 Opening Firewall

Control Panel -> Windows Firewall

3.2 Advanced setting

image10

3.3 Inbound Rules -> New Rule…

image11

3.4 Rule Type

image12

3.5 Protocol and Ports

image13

3.6 Action

image14

3.7 Profile

image15

3.8 Name

image16
After the above steps, your machine is exposed to the outside world.

4. Assigning Public IP address to your website.

4.1 In IIS, add Binding to website

image17

4.2 Setting IP Address and Port.

If you choose another port, you must add the port number to firewall exception, refer to step 3.
image18

4.3 Accessing website with ip address, don’t miss the last slash.

image19

4.4 Trying this address in another machine.

5. Document