How to Host ASP.NET Application in IIS
Internet Information Services (IIS) are used to host ASP.Net Web application for either used it to show your development progress or for a test run of your websites. Or if you are a freelancer and you want to show your sites to your customer, IIS might be your best and easiest way.
For beginners like me, I created simple instructions in publishing ASP.NET MVC Application in IIS.
I. Go to IIS sites root folder and create new folder.
- First open your IIS Manager. By going to start menu and typing “IIS” and select Internet Information Services from the search result. Refer to the image shown below.
- In your IIS manager expand sites folder and right click on Default Web Sites. Then select Explore to open root directory.
- wwwroot directory appear create a folder inside the directory. This is where we publish our Websites. In my case I name it as MySites.
II. Publish ASP.NET Website
My Site Preview:
- Open your project in visual studio 2013 and go to solution explorer. Right click on your project name and select publish.
- In the Publish Web Window choose Profile and then create new profile name for your publish profile.
- Enter your desired publish profile name. Then press “OK”.
- Click “Next” to proceed. Use File System as your publish method.
- Select your published directory. In my case it is C:\inetpub\wwwroot\MySites which the default website directory of IIS. Then click “Open”.
- Lastly click on publish button.
- Wait for Visual Studio to finish publishing.
III. Convert your website to IIS Application
- Go to your IIS Manager and navigate to Sites-> Default Web Sites. Then search for your folder name where we published our websites. In my case I name it MySites. Right click on MySites folder and select Convert to Application.
- You’re done!! To browse your site right click on MySites Select Manage Application then choose browse.
- Browser will appear with your site preview.
- You can also access your websites using your local IP ex. http://192.168.1.2/MySites
Thank you for reading!
Hopes this help. Enjoy coding!!
Post you may like: