Whether you built ASP.NET application or MVC application,
you can run your application in IIS.
Pre-requisites:
-
Running IIS
-
Visual Studio
If you already have a web application running in Visual
Studio Move to Step 2.
Step 1: Create Application
Create a Web Application ->
ASP.NET web application or MVC application.
(Note if you already have created your Application then go to Step 2.)
1) Add
new HTML Page and name it index
2) In
index.html page enter just few lines of code.
Below body tag write:
And
then save.
- Under
Sites Folder -> Add Website
Enter
Site name, Select appropriate Physical path of website be careful in selecting
the project folder, Enter Host Name (Host name will be the URL with which you
will be able to access application).
Let’s Browse Website:
Now when you click Browse Website, you won’t be able to
browse it, because you haven’t made the host entry. System isn’t able to
identify that yes it has to look in local IIS for the application you want to
browse.
Step 3: Run Notepad application in Administrator Mode.
Open the hosts file which is located at
C:\Windows\System32\drivers\etc
Do the host entry -
127.0.0.1 aspapplication.com
Now Let’s Browse.
You will come up on following error:
This is because IIS do not have read permissions.
Step 4: Provide permissions to IIS
For giving permissions to IIS right click on your Website in
IIS and then go to Edit Permissions. Then
go to Security Tab, click on Edit, click on Add, click on Advanced, click on
Find Now, and then select IUSR OK,
Again click on Advanced select IIS_IUSRS and then OK, OK, OK.
Provide full control to both groups.
That’s it.!
You can now browse your application with URL:
aspapplication.com
Feel free to fire queries.
Happy Coding..!!! J
J