By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,173 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,173 IT Pros & Developers. It's quick & easy.

web access failed - argghh

P: n/a
Hello all,

Here's the setup:

I've got VS.NET 2003 installed on a Windows 2003 Server. I've got multiple
sites configured as listed below using host headers:

dev.mydomain.com
ip: 127.0.0.1
host headers: dev.mydomain.com, empty (as in no value)
root directory: e:\web sites\dev.mydomain.com
root directory is shared as wwwroot$

www.someotherdomain.com
ip: my server's only external ip
hostheaders: www.someotherdomain.com, someotherdomain.com
root directory: e:\web sites\www.someotherdomain.com

Now, when I try to create an ASP.NET application using
http://localhost/appname, I get the dreaded web access failed message. The
weird part is, the physical path it is trying to use is the physical root
directory of the second web site (i.e. e:\web
sites\www.someotherdomain.com). Since of course, I am specifying localhost,
the first website, the paths are conflicting and visual studio .net is
complaining about a valid conflict. This I understand.

What I don't understand is, given that the dev.mydomain.com website is the
only website configured to listen on 127.0.0.1 on my server, and also given
that I am specifying localhost in the url, which cannot resolve to anything
other than 127.0.0.1 (as specified in the hosts file), how in the heck is
VS.NET obtaining the physical root path for the OTHER domain? Sure, I can
make the site work if I manually type in the correct path each time I create
a project, but I shouldn't have to, and I don't want to force my other
developers to do so.

Any thoughts?

--
chris
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Forgive the accidental post under the name Microsoft. I had mis-read the
settings box when configuring the news account. Most humble apologies...

--
Chris
Nov 19 '05 #2

P: n/a
Well, I'm still hoping someone replies, but I thought I'd list my interim
solution in case others have come across this problem:

1. Open IIS, right click on the actual site you're trying to use for
development.
2. Ensure that it is the default site by making sure it lists on all IP
addresses on port 80, and will accept any host header (this config is
default for the Default Web Site).
3. Right click the site itself and click Backup Configuration, save config
backup somewhere on your server
4. Right click the IIS root in the mmc and click Restore Configuration.
5. Browse to and select the backup you just created, select the site you're
trying to restore (should be only 1 in the backup file).
6. When prompted, choose the option to replace the existing site.

Apparently, here's what goes down:

Visual Studio .NET is picking up configuration info for whatever site was
last created, not the default web site as you might assume. Therefore, if
you create an additional site beyond the Default Web Site, and try to use
the Default Web Site for development, you'll get path errors and the "Web
access failed" dialog. By doing a backup/restore with the replace option,
you tell IIS to remove the original site and recreate the default website,
which now has a more recent site ID in the metabase. This causes VS.NET to
pick up the configuration information for the newly restored site, instead
of the previously created site. Because of this, your expected physical
path will now be correct, and VS.NET will carry on happily.

I don't like this solution, because I have to do it everytime I want to add
another virtual server, but hey it works without fail. It's also worth
noting that because you're doing a backup/restore from within IIS, all of
the virtual directory settings within the site are maintained in the
re-created version of the site, so there are no issues there.

"Microsoft" <ri************@community.nospam> wrote in message
news:eW**************@TK2MSFTNGP15.phx.gbl...
Hello all,

[snip]
Now, when I try to create an ASP.NET application using
http://localhost/appname, I get the dreaded web access failed message.
The weird part is, the physical path it is trying to use is the physical
root directory of the second web site (i.e. e:\web
sites\www.someotherdomain.com). Since of course, I am specifying
localhost, the first website, the paths are conflicting and visual studio
.net is complaining about a valid conflict. This I understand.

What I don't understand is, given that the dev.mydomain.com website is the
only website configured to listen on 127.0.0.1 on my server, and also
given that I am specifying localhost in the url, which cannot resolve to
anything other than 127.0.0.1 (as specified in the hosts file), how in the
heck is VS.NET obtaining the physical root path for the OTHER domain?
Sure, I can make the site work if I manually type in the correct path each
time I create a project, but I shouldn't have to, and I don't want to
force my other developers to do so.

[snip]
Nov 19 '05 #3

P: n/a
HI Chris,

First, I shall thank you for sharing your experience on this issue with us.
As for the problem when creating asp.net web application in IIS, yes, what
you've found is correct, the VS.NET dosn't really locate the file shared
path from the sitename you specified in the http url, but from some cached
storage which contains the site path that is previously used. And this is
the existing problem when we creating web site through fileshare mode(the
default mode).

Also, when using host headers, it is recommended that we avoid using the
"localhost" as the site name, but use the host header names. And instead of
using File share mode, we can use the PFSE mode which will no longer look
for any shared folder but directly locate the path from the http url
address we specify at the begining.

In addition, in VS.NET2005, ASPNET2, the new "Projectless" asp.net
development feature may greatly improve the asp.net web application
development. We'll no longer need to struggle with the web applicaiton
project file and we can create a web application directly on a normal
filesytem folder rather than IIS vdir.

Thanks again for your posting.
Steven Cheng
Microsoft Online Support

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

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.