- Publish your project, Create new profile, set export path, select Release version over debug and then Publish
- Enable IIS feature:
a. search for program and feature (
Windows + R
(run dialog box) and typeservices.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.
- Copy You published directory to
C:\inetpub\wwwroot\
- Open IIS Manager dashboard (
windwos + r
(run dialog box) and typeinetmgr
and hit enter) - In your
Sites -> Default web site
You should see your published directory - Right click on that and select
Convert to Application
- Keep note of your ApplicationPool, by default it will be
DefaultAppPool
. - Click on
Application Pool
from left side bar and make sure you are using .Net Framework version4.0
not2.0
. Most of the time2.0
is selected as default. - 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.
- If Everything goes right, you should see your website running. Yay!!