musings from a snowstorm....

jim blizzard's blog

"403 Access Forbidden" when attempting to create an ASP.NET web project

A few weeks ago I had one of those days...

I hosed my development environment, so that every time I attempted to create a new ASP.NET web application in VS.NET 2003, I would get the following error message:   The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'.  'HTTP/1.1 403 Access Forbidden'.

I could create a web project in VS.NET 2002 without any problem (on the same machine).  Another fun note was that if I created the virtual directory first in IIS manager, and create a project in VS 2003 pointing to that vdir it would work.

I looked through the MSDN docs, through the news groups, etc., but couldn't find a way to resolve the issue.

Turns out that I had somehow set my default web site’s Home Directory > Execute Permissions to None.  Once I changed it back to Scripts only, bingo.  VS.NET 2003 was happy.

So if you get a 403 Access Forbidden error message when attempting to create an ASP.NET web app in VS 2003, take a look at your execute permissions...

bliz

Published Monday, July 28, 2003 4:18 PM by jimblizzard

Comments

 

Valeriy said:

Thanks for advise, it helped !!!
August 18, 2003 9:43 AM
 

jim blizzard said:

Cool! Makes my day!
August 18, 2003 10:25 AM
 

jmatter said:

VS 2003 must make the permissions change during the install(?). I wated 3 hours trying to fix this. Thanks!
September 2, 2003 1:14 PM
 

musings from a snowstorm.... said:

September 12, 2003 8:07 PM
 

Tom Hanrath said:

This works great. THANKS! (PS jmatter...just change the permissions now...it works)
September 17, 2003 4:48 AM
 

Nat said:

Thank you for posting this, you saved me hours of time.

For some odd reason the install took away execute permissions AND removed read permissions in IIS for the Default web site. Other people in my company with similar setups (Windows 2000 server, running .net 2002) did not have this happen after installing .NET 2003. Just my luck.
September 22, 2003 12:51 PM
 

GOGO said:

You are the man! Damn M$!
September 25, 2003 3:46 PM
 

bliz said:

Gogo: glad you were able to get it working! -- bliz
September 25, 2003 4:18 PM
 

Vlad said:

THANK YOU!!! IT IS SO SIMPLE BUT IT WASTED SO MUCH OF MY TIME UNTIL I FOUND YOUR POST. YOU SAVED ME FROM REINSTALLING EVERYTHING FROM SCRATCH.
October 5, 2003 1:25 PM
 

eswar said:

Thank u.
October 20, 2003 4:16 AM
 

Colin said:

excellent! I had the same issue, thanks
November 4, 2003 9:01 PM
 

bliz said:

Hi Denisse, did you follow the steps I took above? If you're having the same problem, that should fix it. If it doesn't fix it, I'd recommend that you post the details of your problem to the newsgroup: microsoft.public.dotnet.framework.aspnet OR microsoft.public.vsnet.ide.

Hope this helps,
- bliz
November 11, 2003 12:13 PM
 

shiv said:

Thanks for this post. it helped and saved my time to figure out the problem. I got this problem when i tried to impersonate stuff in machine config file and iis locked my a/c and reset some of other stuff too. I suggest somebody should post such simple answers to our common everyday problems involving VS. perhaps Microsoft should have a site dedicated to such problems.
thanks anyway
November 18, 2003 12:05 PM
 

muadib said:

Thanks for the help!
November 20, 2003 12:21 AM
 

Tony M said:

I did try scripts only but got this error:

The web was created successfully, but an error occurred when trying to configure the application root for this web. Web projects may not operate correctly without an application root. The returned error was: Active Directory services can not find the web server. A possible cause for this is an incompatibility between versions of Internet Information Server (IIS) on the client and the server. The usual cause for this error is creating web projects on a Windows 2000 or newer server from a Windows NT 4.0 client. You can manually configure the application root using the Internet Services Manager.

I am not using NT on my development machine, it is XP Professional.

But to resolve the error I went to the Windows 2003 server and did the following in IIS Manager:
1) Right click on default website
2) Select Properties
3) Clicked on Home Directory tab
4) under the Execute Permissions list, selected "Scripts and Executables"

Clicked OK and it works like a charm.
--
Tony

December 2, 2003 10:59 AM
 

Farahmand said:

Thank you :D
December 4, 2003 8:47 AM
 

bliz said:

Tony: glad you were able to get it working.

Farahmand: glad it help.
December 4, 2003 8:46 AM
 

Sam said:

---------------------------
Microsoft Development Environment
---------------------------
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/WebApplication1'. 'A connection with the server could not be established'.
---------------------------
OK Help
---------------------------

I have script only execute permissions .. works fine in VS.NET however in VS.NET 2003 get that error

Any Suggestions.
December 8, 2003 1:46 PM
 

bliz said:

Sam,

It could be a number of things. I'd recommend you do a search from msdn.microsoft.com, using the keywords "a connection with the server could not be established visual studio .net create project" or something to that effect.

Hope this helps,
bliz
December 9, 2003 12:34 PM
 

Ashutosh Bhalerao said:

Thank you. Solved it for me.-Ashu

I changed my application to use https and installed a server certificate. Source safe could not connect to the IIS server to download the latest version of the code. Maybe this might solve that problem as well.
December 13, 2003 5:22 AM
 

May said:

Each time when I try to create a new ASP.NET web application in VS.NET 2003, I would get the following error message:

The web server reporting the following error when attempting to create or open the web project located at the following URL:'http://localhost/vb/WebApplication1'.'HTTP/1.1 500 server error'

I looked through the MSDN docs, through the news groups, etc., but couldn't find a way to resolve the issue.



December 22, 2003 5:48 AM
 

bliz said:

Hi May,

Hmmm. You could try repairing your VS .NET installation. Run the VS .Net setup and choose repair.

Hope this helps... -- bliz
December 22, 2003 9:00 AM
 

Faisal Mahmoud said:

I had this same problem. But my root cause was that I had set the server to run on port 8080. I had another machine running an apache server on port 80, so I wanted my windows machine to run on a different port. I guess that didn't work out so well when trying to setup a project.

Anyone know a solution for this?
January 2, 2004 6:09 PM
 

pinky said:

my problem is :The web was created successfully, but an error occurred when trying to configure the application root for this web. Web projects may not operate correctly without an application root. The returned error was: Active Directory services can not find the web server. A possible cause for this is an incompatibility between versions of Internet Information Server (IIS) on the client and the server. The usual cause for this error is creating web projects on a Windows 2000 or newer server from a Windows NT 4.0 client. You can manually configure the application root using the Internet Services Manager.
same as tony's. I already tried changing it to scripts and executables but still get the same error message.... one thing i observed though, when my network cable is plugged, i get the error otherwise it is working well, still puzzles me how can it be happening when i am trying to create a web application in the localhost and do not connect to other computers in the network. i just connect to the network to access internet. please help me. thanks.
January 5, 2004 6:13 PM
 

kar said:

i did change the execute permissions, still i'm getting the same error. Could anyone please advise !
Thanks
January 12, 2004 12:33 PM
 

Andrew said:

pinky: try changing the location of the webservice (when you create it) from http://localhost/[webservicename] to http://127.0.0.1/[webservicename] or whatever ip address / name you specified the server to run on.
January 14, 2004 10:12 AM
 

Drakier Dominaeus said:

What also helps this problem and the 500 Server Error problem is to run aspnet_regiis with the -i flag. this file should ne in the C:\Winnt\Microsoft.NET\Framework\<version>\ location. then you just run aspnet_regiis -i.

-Drakier
January 14, 2004 5:42 PM
 

Thank you said:

And thank you again. I was about to go mad here.
January 22, 2004 12:39 PM
 

mwhalen said:

I'm having the problem with a solution that I've been working with for a couple of weeks now. It worked fine up until today and I don't know what changed to make this happen. I've checked into everything that was suggested here. All of the settings are as they should be, but I still can't get the project (actually projects, there's 4 in the solution I'm working with). I've run aspnet_regiis -i, that didn't help either.

Any more suggestions? I'm running WinXP Pro, IIS 5, IE 6, and I have both VS.NET 2003 and VS.NET 2002 on my machine and the problem occurs in both. I can't open any of the web projects that are on my machine.
January 29, 2004 2:13 PM
 

bliz said:

mwhalen: Your best bet would be to post this type of question on one of the newsgroups, such as microsoft.public.dotnet.framework.aspnet. The newsgroups have experts in the particular area, and should be able to get you an accurate answer.
January 29, 2004 2:45 PM
 

terry said:

Thank you, thank you, thank you.... did everything listed above, but kept getting same error. Final thing that worked was changing from http://localhost/webapp1 to http://192.168.1.10/webapp1 (my server IP on LAN). Even changing to 127.0.0.1 didn't work, any ideas why? ... it was working a few days ago, but I did run some security wizard that obviously locked things down too far.
February 5, 2004 1:38 PM
 

Paul said:

Because I'm french, I say MERCI BEAUCOUP !
February 7, 2004 6:28 AM
 

AlanK said:

Brilliant!

Im using VS.NET 2003, IIS 5, and XP SP1 and setting permissions on default web site to Scripts fixed this problem.

Cheers
Al
February 13, 2004 8:35 AM
 

Alex Rosales said:

Cool... 3 hours, and i find your response! Thanx
February 13, 2004 12:57 PM
 

Dean said:

I had the same symptoms as the problem you have experienced, however, my settings were already set to Scripts Only. After re-installing IIS and running aspnet_regiis I still had the problem. I was only able to fix it by changing the anonymous user of the Default Web Site to a more privelaged user than the default. Thought I'd post my findings here, as this blog appears top when searching for the answer.

Cheers,

Dean
February 26, 2004 1:13 AM
 

bliz said:

Hi Dean,

You shouldn’t have to run with elevated permissions. I’d keep looking for the root cause if I were you. Don’t rely on elevated permissions.

If you develop your app using elevated privileges, when you move to a test or production environment your app may break. During development you may unknowingly program your app to take advantage of the elevated privileges. And you won’t find out until you put it on a box that runs as ASPNET with lower permissions.

bliz
February 26, 2004 8:38 AM
 

おがわみつぎのBLOG said:

"403 Access Forbidden" when attempting to create an ASP.NET web project
March 4, 2004 12:01 AM
 

B.Zomer said:

Maybe a tip. I had tryed tips above. They did not work. The problem was i used SSL. I turned it off en now it works.

B.Z
March 5, 2004 10:41 AM
 

Pramod said:

Thanks this helped!!!!!!!!!!
March 8, 2004 9:26 AM
 

Debbi said:

YOU ARE A LIFE/TIME SAVER. thanks for sharing your information!!!!!
March 27, 2004 3:13 PM
 

David L said:

cheers
March 29, 2004 1:30 AM
 

JAM said:

My setting were correct and it still failed. I restarted IIS and that fixed it.
April 2, 2004 8:16 AM
 

Vandan said:

Bliz,

ur suggestions helped but i also had to check the Read & Write under Home Directory in IIS as they were unchecked for some reason. Also used Microsoft KB for the same.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;160754

Keep the good work

- Vandan
April 11, 2004 9:26 PM
 

hardik said:

i got an error in web access through IIS service in windows XP kindly give me solution on hardik_sis@yahoo.com
April 12, 2004 10:34 PM
 

PG said:

I was getting this problem, but only when IE was set up to go via a proxy server. I found that somehow all the settings in Tools | Connections | LAN Settings | Advanced | Do not use proxy server for addresses beginning with: had been removed. Putting back "localhost" here fixed the problem.
April 19, 2004 9:29 AM
 

bliz said:

PG: good info! Thanks for sharing!
April 19, 2004 9:33 AM
 

HellRazer said:

I also had 403 error but my cause was different:

the installer put the default page (IIS>defaul page>yoursite -> property's -> documents tab)
to default.aspx instead of my project's start page

chnaging this to the correct start page fixed the problem
April 30, 2004 1:44 AM
 

Tomas from CZ said:

Thanks, it works very well

I cannot understand why this help cannot be found on microsoft websites...
May 6, 2004 8:40 AM
 

R said:

May 12, 2004 3:21 PM
 

R said:

May 12, 2004 3:23 PM
 

Emil said:

Was having same problem HTTP/1.1 403. Followed your advice, but it now shows error HTTP/1.1 500 Server Error. Tried to reinstall everything, first IIS 5.1 then Visual Studio, but still no luck, same problem. Someone suggested to run a special command from a command line, but I don't know what the full version no for asp 1.1? Could you suggest? Thanks Emil/.
May 13, 2004 7:57 AM
 

bliz said:

Try this:

Using IIS, create a virtual directory. Create a simple ASPX page. Try to open the page in Internet Explorer. If you still get a 500 error, turn off friendly HTTP error messages in Internet Explorer (Tools | Options | Advanced. Uncheck "Show friendly HTTP error messages.")

If that doesn't shed some light, I'd Google on the terms 500 Server Error Visual Studio .NET.

Hope this helps.
May 13, 2004 8:30 AM
 

Jason said:

yet another "thank you"!
May 18, 2004 2:13 AM
 

mao said:

god bless ya
May 29, 2004 10:49 AM
 

wiching said:

It really works
May 31, 2004 12:15 AM
 

JBoy said:

Getting this error (or similar) ?...

The web server reported the following error when attempting to create or open the web project located at the following URL: 'http://localhost/WebApplication1'. 'HTTP/1.1 500 Server Error'.

Try turning your personal firewall completely off. Like totally unload the mofo.

Just a thought.
June 12, 2004 6:53 PM
 

James said:

Hi

I've been getting the same HTTP/1.1 500 error when i tried to create a new project.

Could it be to do with the fact that i installed php for iis ???

James
June 14, 2004 12:24 AM
 

jack said:

wheeeewwwww! thanks a lot!
June 14, 2004 12:58 AM
 

bliz said:

> Could it be to do with the fact that i installed php for iis?

I'm not familiar with PHP or what it does during the installation. You may want to Google for that.
June 14, 2004 12:07 PM
 

bliz said:

> Try turning your personal firewall completely off.

You may want to try that just to see if it gets rid of the 500 error. But I wouldn't run that way for long, and you probably should disconnect from the network to be safe from intruders while you do it. (My 2 cents.)

There's probably some other root cause than the personal firewall.
June 14, 2004 12:10 PM
 

James said:

no firewall mate
that's the thing, i really don't get why this happens.
June 15, 2004 2:56 AM
 

James said:

it would be really interesting if someone could explain how visual studio actually attempts to create a virtual directory in the root folder when a new project is created. That might help us pin point some strange errors.
June 15, 2004 2:58 AM
 

Chk said:

I have the same error when I try to reopen the VS.NET project. We developed the project without SSL and then we configured the website to use SSL. After doing that when we try to open the project in VS.NET it gives Access Forbidden error. Website directory properties has scripts only. What will be the problem?
June 22, 2004 10:03 AM
 

rahmetleah said:

Thanks it helped
June 29, 2004 8:54 AM
 

Def J said:

w/VS.net 2003-
Error message was still appearing after setting the execute permissions to something other than 'none'.
Error message also appeared when attempting to connect to a VDIR.

Changing the location from
(BAD)
http:\\localhost\WebApplication1
to
(GOOD)
http:\\[server IP address]\WebApplication1

prevented the error message and allowed the "\WebApplication1" subdirectory to be created within the home directory.

Thank you Andrew for posting this information.

Thanks to Bliz for starting this excellent thread about this wacked problem.
June 30, 2004 5:42 AM
 

Ponnurangam said:

This works great. THANKS!
July 1, 2004 2:45 AM
 

Phani Katakam-Hyderabad, India said:

Hi Guys,
Thanks for the above tips...
After setting Execute permission to Scripts only at the Virtual Directory settings, Check the Read option also in the properties(This is just above the Directory Browsing option)..that worked great on my system..then u dont need to set your IP Address also...thanks
July 8, 2004 3:08 AM
 

shai said:

Thanks , you make my day
July 14, 2004 2:15 AM
 

Gabriel "brainman" Blum said:

My solution:

Check if default.aspx is set as default page. If not, IIS tries to browse directory, which usually doesn't have permission.

Adding default.aspx as default page solved for me
August 3, 2004 11:42 AM
 

ferha said:

I created a Web Application in Visual Studio .NET. I can access an aspx page from a .NET program (C#) successfully, but when I try accessing it using WinHttp, I get the 403 error. Any idea about which library I should be using to access an aspx page through VB?
August 3, 2004 6:42 PM
 

ferha said:

I forgot to mention - I tried changing the permissions as described above, changed the URL from localhost to the actual IP address (I'm trying it from my own machine), but nothing seems to work. My development m/c is Windows XP
August 3, 2004 6:45 PM
 

Julie Lerman Blog said:

July 25, 2005 6:28 PM
 

Chin Blog :-) &raquo; Blog Archive &raquo; Help Help 403 Error said:

September 8, 2008 1:50 PM
Anonymous comments are disabled

This Blog

Syndication

News

Notice: The views expressed on this weblog are mine and do not necessarily reflect the views of my employer.




© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker