Unable to Open a new asp.net web service

B

Bruce

I am doing development work on an asp.net app and a web service on a Win XP
Pro SP2 development workstation, using vs.net 2003. For reasons that I
wont try to explain here, I recently moved the application files from
/inetpub/wwwrooot to a directory within "my documents", and I changed the
home directory within IIS accordingly.

However, now when I try to open a new Web Service project in vs.net, I get a
dialog box with this error: "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/test/WebService1.
"HTTP/1.1 500 Internal Server Error".

From Googling newsgroups, I see that one likely solution would be to grant
the ASPNET process access rights to the target directory (read, list folder
contents, r&e). I tried that, but no luck. Another article described the
need to grant these rights sequentially to each level of the directory from
my target all the way up to c:\. I tried that, but no luck.

I also noticed that existing asp.net pages that worked fine in their old
locations in /inetput/wwwroot do not work in their new locations, even after
going into IIS and creating new "applications" for them. When I try to load
one of those asp.net pages, I get an error message in the browser which I
cut-and-pasted below.

What could be the cause and solution?

Thanks, Bruce
-------------------------------

Server Error in '/' Application.

--------------------------------------------------------------------------------

Server cannot access application directory 'C:\Documents and
Settings\bruce\My Documents\HomePage\Inetpub\wwwroot\'. The directory does
not exist or is not accessible because of security settings.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Server cannot access
application directory 'C:\Documents and Settings\bruce\My
Documents\HomePage\Inetpub\wwwroot\'. The directory does not exist or is not
accessible because of security settings.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Server cannot access application directory
'C:\Documents and Settings\bruce\My Documents\HomePage\Inetpub\wwwroot\'.
The directory does not exist or is not accessible because of security
settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263

[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +983
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128
 
S

Steven Cheng[MSFT]

Hi Bruce,

Thanks for your posting. I've also noticed and replied you in another
thread named:

"How to open an asp.net project in vs.net when no .sln is available"

After reading your this thread, I think the problem is much more complex
than I've expected earlier. First, as for moving IIS site's home directory
to a certain dir under MyDocument folder, this is really a dangerous action
which make me feel very nervous. This will cause many problems , such as :

1. the folders under document settings are far from qualify for being used
as web site's home dir, most accounts won't have the suffiecient
permissions to access them. And ASP.NET will need access permissions from
the root of site to the app's dir or sub dirs to do some monitoring works

2. Since the MyDocument folder is under the per user(account) available
location, when different users logon, they'll even be unable to access
them.

So I strongly recommend that you choose some other public folders to be
your site's HOME DIR. Choose another ordinary folder and the following
article maybe helpful:

HOW TO: Use File Share Mode for a Share Other Than the Default wwwroot$
Share
http://support.microsoft.com/default.aspx?scid=kb;en-us;320265

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
B

Brock Allen

The problem is the security on the files in the My Documents folder. The
ASPNET account doesn't have access to the files so ASP.NET won't be able
to read them. Put your files elsewhere or change the security on the file
to allow the ASP.NET account to read them.




I am doing development work on an asp.net app and a web service on a
Win XP Pro SP2 development workstation, using vs.net 2003. For
reasons that I wont try to explain here, I recently moved the
application files from /inetpub/wwwrooot to a directory within "my
documents", and I changed the home directory within IIS accordingly.

However, now when I try to open a new Web Service project in vs.net, I
get a dialog box with this error: "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/test/WebService1. "HTTP/1.1 500 Internal Server
Error".

From Googling newsgroups, I see that one likely solution would be to
grant the ASPNET process access rights to the target directory (read,
list folder contents, r&e). I tried that, but no luck. Another
article described the need to grant these rights sequentially to each
level of the directory from my target all the way up to c:\. I tried
that, but no luck.

I also noticed that existing asp.net pages that worked fine in their
old locations in /inetput/wwwroot do not work in their new locations,
even after going into IIS and creating new "applications" for them.
When I try to load one of those asp.net pages, I get an error message
in the browser which I cut-and-pasted below.

What could be the cause and solution?

Thanks, Bruce
-------------------------------
Server Error in '/' Application.

----------------------------------------------------------------------
----------

Server cannot access application directory 'C:\Documents and
Settings\bruce\My Documents\HomePage\Inetpub\wwwroot\'. The directory
does
not exist or is not accessible because of security settings.
Description: An unhandled exception occurred during the execution of
the
current web request. Please review the stack trace for more
information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Server cannot access
application directory 'C:\Documents and Settings\bruce\My
Documents\HomePage\Inetpub\wwwroot\'. The directory does not exist or
is not accessible because of security settings.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Server cannot access application
directory
'C:\Documents and Settings\bruce\My
Documents\HomePage\Inetpub\wwwroot\'.
The directory does not exist or is not accessible because of security
settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263
[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +983
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
+128
 
B

Bruce

Steven,
Point taken. I'm just going to leave the files withing their default
location.
Thanks,
Bruce
 
S

Steven Cheng[MSFT]

Thanks for your reply.

The default loation is ok. Also, if you have interesting, you can try
creating a new site on some other normal disk and test through the KB I
provided in the last message. That can also help us get a clearer view of
such problem.

Thanks,


Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top