PDA

View Full Version : running ASP.NET web site on local IIS server [RESOLVED]


chump2877
09-02-2007, 04:10 AM
I created a web site in VS2005, and originally specified the location as the local file system.

Now I want to publish the site on my local IIS server for testing.

I created a new virtual directory in the Computer Management dialog, via right clicking on Services and Applications -> Internet Information Services -> Web Sites -> Default Web Site, selecting New -> Virtual Directory, and running the wizard.

In the wizard, I set the local path to the path of my VS2005 project folder inside of my My Documents folder. I set the default permissions.

I go to IE and type in http://localhost/ProjectName/default.htm in the address bar. I get the following error:


You are not authorized to view this page

You do not have permission to view this directory or page using the credentials you supplied.

HTTP 401.3 - Access denied by ACL on resource
Internet Information Services


So I don;t see the web site....What am I doing wrong here?

Also, what is best practices for publishing an ASP.NET web site/application and running it on IIS? I hear you can also publish a web site, without creating a new virtual directory, by simply dumping the necessary files into the C:\Inetpub\wwwroot folder...Which way is better, and, again, how do you go about successfully implementing that way?

Thanks.

PremiumBlend
09-02-2007, 08:58 PM
What version of IIS are you using?

chump2877
09-02-2007, 09:58 PM
IIS 5.1....the version that comes with Win XP Pro...

PremiumBlend
09-02-2007, 10:02 PM
If this is similar to a problem I had once, you'll want to go into IIS and find the directory, right click and view properties.

Make sure "Execute Permissions" is set to 'Scripts and Executables' and you may have to give it an application name.

Hope this helps.

chump2877
09-02-2007, 11:04 PM
Thanks for your help, but changing the permissions didn;t work....

Allowing executables to run doesn;t sound very safe either....

And I gave the application a name when I ran the Virtual Directory Creation wizard....

One thing I have noticed is that there is no physical directory equivalent (of the virtual directory) found in C:\Inetpub\wwwroot....Does that mean anything?

screenshot of my wwwroot directory:
http://www.mediamogulsweb.com/client/images/scrnsht1.jpg


screenshot of my Computer Management console (Week11 is the new virtual directory I created):
http://www.mediamogulsweb.com/client/images/scrnsht2.jpg

chump2877
09-03-2007, 03:43 AM
This problem has been resolved.

Briefly, for anyone else who might have a similar problem, the steps that I took to resolve the issue:

1) If you created the project with VS2005, using the default settings in which your projects are saved in the C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Projects\ directory, copy the project to another directory in your root C:\ directory. I created a folder called C:\VS2005 Web Apps\ and saved another copy of my VS2005 project there. Also, in the virtual directory properties dialog box, I changed the Local Path to the new location. The permissions problem I was having was solved by removing the project from the My Documents folder.

2) Then I got another error when trying to view a .aspx file. The error is documented here (http://forums.asp.net/p/887716/934023.aspx), and a fix is provided:


C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis -i

this will make it work ;)

Greetz,

P


Make sure you change the version number (in bold) to your version. The version was v2.0.50727 on my machine...

After doing this, I got IIS up and running on my machine...:thumbsup: