How to deploy asp.net application in IIS server
I am developing C# MVC 4.0 project in Visual Studio and it is working good. Now I want to test my application in IIS server install locally. Windows 8/10 come with IIS by default, just need to enable it.
Here I am sharing how you can publish your application to IIS server.
1) Right Click project in Solution explorer and select “Publish”
2) Profile: Create new profile using dropdown. Enter the name of the profile by selecting “<New…>” from the dropdown.
3) Connection: Select “Publish method” as “Web Deploy” and “Service URL” as “localhost” and “Site/Application” as “Default Web Site/test1” (See below screenshot)
Click on “Validate Connection” button at the bottomm of “Connection” section. you should get green right mark. If you enter site something else then “Default Web Site” it will give error as below:
Web Deployment task failed. (Site ‘localhost’ does not exist Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_SITE_DOES_NOT_EXIST).
4) Settings: Configuration can be “Debug” or “Release”. I have selected as “Debug”. And uncheck all checkboxes under “Database” section. In my case i am using local database only. So ignore this.
5) Preview: On preivew, click on “Start Preview” button in the middle of the popup. it will start listing all your files and other assets that need to add to local server.
6) Publish: Finally click on “Publish” button at the bottom of the popup. It will start publishing your site to IIS server.
7) Verify IIS: Now open your IIS Manager and check Sites=> Default web site => test1 will get listed. Now you can select the Application and from right pane click on browse, your site will launch on default browser.
My application versions:
IIS version: 10
Visual Studio : Ultimate 2012
C# : MVC 4.0
Hope this will help some.