Skip to content

Instantly share code, notes, and snippets.

@przbadu
Last active September 8, 2017 06:16
Show Gist options
  • Save przbadu/37237e5740bbdbf877466efa31d19da1 to your computer and use it in GitHub Desktop.
Save przbadu/37237e5740bbdbf877466efa31d19da1 to your computer and use it in GitHub Desktop.
Deploy Asp.net mvc web application to IIS server
  1. Publish your project, Create new profile, set export path, select Release version over debug and then Publish
  2. Enable IIS feature: a. search for program and feature ( Windows + R (run dialog box) and type services.msc and hit enter). b. Turn windows features on and off c. Internet Information System (IIS) d. Check Web Management tools -> IIS Management Console e. World Wide Web Services -> Check all (Application Development Features), Common HTTP Features and others as required. f. Click ok, and restart computer. g. sometimes this is not enough, as a safe side, run below commands
cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe -ir

NOTE: run this command after you enabled iis server and then put your content inside inetpub wwwroot directory.

This command will install missing dependencies for .net version 4.x and you are good to go now.

  1. Copy You published directory to C:\inetpub\wwwroot\
  2. Open IIS Manager dashboard ( windwos + r (run dialog box) and type inetmgr and hit enter)
  3. In your Sites -> Default web site You should see your published directory
  4. Right click on that and select Convert to Application
  5. Keep note of your ApplicationPool, by default it will be DefaultAppPool.
  6. Click on Application Pool from left side bar and make sure you are using .Net Framework version 4.0 not 2.0. Most of the time 2.0 is selected as default.
  7. We are almost done with publishing website to IIS server locally, now right click on your website from left side bar and then go to Manage Application -> Browse.
  8. If Everything goes right, you should see your website running. Yay!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment