Setting Up Classic ASP Websites on IIS 7.5 with Visual Studio 2010
There are still many websites built and maintained with classic ASP because of many reasons. This post will cover two topics – how to setup classic ASP websites on IIS 7.5 and how to manage codes using Visual Studio 2010.
Conditions:
- OS: Windows 7 Professional SP1
- Web Server: IIS 7.5
- IDE: Visual Studio 2010 Professional SP1
I haven’t tested it any other than above. So, if you have a little bit different environment from mine, please bear in mind.
How to Setup Classic ASP Websites on IIS 7.5
Firstly, your IIS must turn on ASP features. Go to Control Panel > Programs and Features > Turn Windows features on or off
. Then, tick the checkbox next to ASP
and click OK
.
Now, your IIS is able to run ASP websites. The next step is that your IIS needs a new Application Pool for the ASP websites. Go to Control Panel > Administration Tools and open Internet Information Services (IIS) Manager
. Then create a new Application Pool.
Make sure that an administrator account as a Custom account
for the Application Pool Identity
must be selected. From the diagram above, Administrator
is selected.
Once the new Application Pool is added, a new website using this Application Pool needs to be created to host classic ASP pages.
A new website for classic ASP is now created. It’s time for the website to recognise ASP script. Go to the website you’ve just created and find ASP
item under the IIS
section. Click it and set the below four to “TRUE
“.
Once you finish the steps above, your classic ASP website should be up and running. This IIS setting also helps your Visual Studio 2010 debug the web page script.
Now, it’s time for Visual Studio 2010 to setup to manage the classic ASP codes.
How to Manage Classic ASP Codes Using Visual Studio 2010
In order for your VS 2010 to manage the classic ASP codes, three things must be done before starting to code.
First of all, register .asp
file extension to your VS 2010.
This enables you to see syntax highlighting and code intellisence feature. Now, open the website by clicking File > Open Web Site…
. Make sure that it’s “File System
“, not anything else.
Depending on your preference, create a new solution and add a new website project under the solution. By doing so, the website will be more manageable.
Now, it’s time to create a web page. Create a new item and select an HTML Page. As a default, the filename will be HTMLPage.htm
. Rename it to default.asp
.
A new default.asp
page is created. Type some classic ASP code into the page.
As we have already setup the syntax highlighting and code intellisense feature, in order to enjoy them, put the code <%@ Language="VBScript" %>
at the first line and you will see the result like above.
Open your web browser and open the page you just created.
Please note that you can see the break point at the left next to the line number. That means we can also debug the classic ASP codes. As usual, in order to utilise the debug functions, you have to run VS 2010 as an administrator privilege. Before starting to debug, the website property must be configured.
As VS built-in web server doesn’t support classic ASP, we have to use our local IIS for debug. So, setup the property like above. And use “Attach to Process
” from the Debug
menu. Once you run the “Attach to Process
” command, you’ll get the screen like below. Find w3wp.exe
bound by the account that we setup on IIS previously (that is Administrator
here in this post).
Now, try to run the website again and you’ll get the break point highlighted.
So far, we have setup and reviewed how to set up classic ASP website to run on IIS 7.5 and code it on VS 2010. By default, classic ASP is not chosen by IIS and VS 2010. So, some configuration change must be performed in order for that.
Try it and enjoy your ASP coding.
Thank you for good tip. 🙂
이정헌
04/02/2014 at 20:18
My pleasure!
Justin
04/02/2014 at 20:40
1) How do you add Administrator account into Application Pool Identity?? I guess it is created by default and we don’t know the password. When I try to add through custom, it ask for password.
2) Also for some reason, I don’t see W3Wp.exe process started, I can not attach to it. Any idea??
nirav patel
12/03/2014 at 02:50
@nirav
1) You can add NETWORK SERVICE instead, which won’t ask you to put a password. I’m pretty confident when you install Windows you should be asked to enter a password for the Administrator account. If you don’t remember it, ask your system administrator.
2) As long as you run the website at least once, the w3wp.exe will be seen. If you can’t see it, run the website once, regardless it’s failing to load or not.
Justin
13/03/2014 at 23:06
Hi Justin,
Thanks for the Above mentioned Procedure.
I have followed the mentioned procedure after that am getting 401.5 error, which says
” HTTP Error 401.5 – Unauthorized
The URL you tried to reach has an ISAPI or CGI application installed that verifies user credentials before proceeding. This application cannot verify your credentials. ”
can you please provide any help.
Thanks in Advance.
fareedbaba
12/11/2014 at 19:40
@fareedbaba
This might help you figure out your issue.
http://support.microsoft.com/kb/942078/
Justin
12/11/2014 at 20:55
good article!!! it’s Great!! thank you very much!!!!
Goblin Ct
14/01/2015 at 02:01
@Goblin
My pleasure!
Justin
14/01/2015 at 09:57
@Justin, Thks!! great article!!!! Helped me a lot ;D
Also works with Vstudio 2012 =D
Ricardo Ribeiro
12/08/2015 at 04:39
Happy to hear that.
Justin
12/08/2015 at 14:37
Would it work for IIS 8??
Adil Ansari
17/02/2016 at 22:44
Why not? Just try it. Haven’t tested it on IIS 8 but not much differences between IIS 7 and 8 regarding to this feature.
Justin Yoo
18/02/2016 at 08:54