Can't use localhost

D

Dave Uphoff

I have loaded the Visual Studio.net onto a Windows 2003 Server operating
system. I am unable to load in a web project into the NET system because I
get an HTTP 404 error as follows:
Unable to open Web project 'Webcity'. The file path
'D:\Inetpub\wwwroot\webcity' does not correspond to the URL
'http://localhost/webcity.' The two need to map to the same server
location.

Does anyone know what I have to do to get the NET development system to
relate localhost to the location of my project? Thank you.
Dave Uphoff
 
C

Cowboy \(Gregory A. Beamer\)

This gets to be a bit more fun, since you have your webroot on a drive other
than system (a good thing in many respects). The easiest way is to make sure
the root web is grounded at D:\Inetpub\wwwroot. If not, it will try to go to
that root first. More importantly, make sure the virtual root in question is
an application; this can be done either in Windows Explorer (right click
folder and then web sharing tab under the properties dialog) or IIS Manager
(Right click project and go to home directory and hit create an
application).

If neither of these work, double click on the .csproj or .vbproj file and
allow VS.NET to recreate the solution file. Once recreated, you are running
fine.

One more thing, consider checking the HOSTS file
\\Server\Windows\system32\drivers\etc and make sure there is an entry for
local host.

BTW, you can often get around the localhost issue by using 127.0.0.1, the
name of the computer or the IP of the computer to create a project.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
D

Dave Uphoff

Hi Gregory;
Thanks for your reply to my problem on getting the localhost to work on
my C# Web project in NET. I tried your suggestions and I still get the
same error message. I should mention that I imported this project from
a Windows XP environment into a Windows 2003 Server environment. Do you
think this is causing the problem, and if so, do you have any
suggestions on how to get around it short of creating a new project and
then importing the files separately?
Dave Uphoff
 
M

mikeb

Dave said:
I have loaded the Visual Studio.net onto a Windows 2003 Server operating
system. I am unable to load in a web project into the NET system because I
get an HTTP 404 error as follows:
Unable to open Web project 'Webcity'. The file path
'D:\Inetpub\wwwroot\webcity' does not correspond to the URL
'http://localhost/webcity.' The two need to map to the same server
location.

Does anyone know what I have to do to get the NET development system to
relate localhost to the location of my project? Thank you.
Dave Uphoff

See these KB articles:

http://support.microsoft.com/default.aspx?scid=kb;en-us;327283

http://support.microsoft.com/default.aspx?scid=kb;en-us;831210
 
D

Dave Uphoff

Thanks for your reply. I applied the fixes suggested in the articles
but I still get the HTTP 404 error. I installed Visual Studio 2003 on
an XP system and do not have the same problem. Any other suggestions?
Dave UPhoff
 
M

mikeb

Dave said:
Thanks for your reply. I applied the fixes suggested in the articles
but I still get the HTTP 404 error. I installed Visual Studio 2003 on
an XP system and do not have the same problem. Any other suggestions?
Dave UPhoff

Well, now I'm grasping at straws... are you sure IIS is installed and
ASP.NET is enabled - this has to be done explicitly on Win Server 2003.
 
D

Dave Uphoff

I have IIS installed and everything under Web Service extensions is
enabled including ASP.NET. My localhost directory is located under My
Network Places which I find unusual since I cannot find a localhost
directory specified in my Windows XP box. Someone else installed
Windows 2003 Server on this computer and I am wondering if they did
something wrong. Basically, the pointer for localhost is wrong and I
don't know how to right it short of deleting the localhost directory
under My Network Places and see where that takes me. Any suggestions?
Dave
 
M

mikeb

Dave said:
I have IIS installed and everything under Web Service extensions is
enabled including ASP.NET. My localhost directory is located under My
Network Places which I find unusual since I cannot find a localhost
directory specified in my Windows XP box. Someone else installed
Windows 2003 Server on this computer and I am wondering if they did
something wrong. Basically, the pointer for localhost is wrong and I
don't know how to right it short of deleting the localhost directory
under My Network Places and see where that takes me. Any suggestions?
Dave

If localhost is pointing to some other machine, then someone pulled a
very dirty trick on you.

You might want to ping localhost, and see what IP address the system
thinks localhost is. It should say "127.0.0.1".

Look in %WINDIR%\system32\drivers\etc\hosts for the localhost entry.

It should be:

#-----------------------------------------------

127.0.0.1 localhost

#-----------------------------------------------

If it's missing or is anything else, then that's your problem.
 
D

Dave Uphoff

I do have the proper entry for localhost in
windows\system32\drivers\etc\hosts and I can ping localhost. It returns
127.0.0.1. I am baffled and am wondering if it isn't a bug in Windows
server 2003 or Visual Net Studio 2003. I don't have these problems on
Windows XP or Windows 2000. Time to call Bill Gates. This type of
experiences really humbles me as I have been programming since 1966 and
I never use to have to waste this kind of time trying to get things to
work. Give me a logic problem in coding anyday.
Dave
 
M

mikeb

Dave said:
I do have the proper entry for localhost in
windows\system32\drivers\etc\hosts and I can ping localhost. It returns
127.0.0.1. I am baffled and am wondering if it isn't a bug in Windows
server 2003 or Visual Net Studio 2003. I don't have these problems on
Windows XP or Windows 2000. Time to call Bill Gates. This type of
experiences really humbles me as I have been programming since 1966 and
I never use to have to waste this kind of time trying to get things to
work. Give me a logic problem in coding anyday.
Dave

OK, now for the basics:

1) launch IE on the Win2k3 server, type localhost into the address
bar and press enter - what do you see? (I get a "Under Construction" page).


2) Open the IIS Manager applet, and navigate to the "Default Web
Site", bring up it's Properties page, click on the "Home Directory" tab.
What is the "Local Path" configured to? (it's c:\inetpub\wwwroot on
my machine)

3) place a text file in the "Local Path" directory and name it
"default.htm", if you press the reload button in IE, the contents of the
text file should display in the browser.


If all of the above look OK, then the basics of IIS are working, and
localhost is probably OK. If this stuff is working, we can look at
ASP.NET without VS.NET next...
 
R

Ricky K. Rasmussen

Hi Dave,

I had the same problem, but solved it by adding the MIME type of text/plain
to tmp files on the IIS website:
1. In the properties for your website, click the HTTP Headers tab
2. Click the MIME types button, and add a new MIME type by clicking New
3. For extention use ".tmp", and for MIME Type use "text/plain"

That should be it!

I cant remember if it's necessary, but I run my IIS in 5.0 isolations mode
(found on the service tab of the WebSites properties). This might have to do
with the application I'm running though.

/ricky
 

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

Top