So tired of this bug

G

Guest

Hi,

I am so so tired of getting this error message when I try to open a web
project or create a new one:

The web server reported the following error when attempting to create ot
open the web project located at the following URL: 'http://localhost/...'
A connection with the server could not be established

I usually fix it somehow (see my collection of solutions at the bottom of
this message) but it allways comes back with minor changes in the error
messages. And it allways comes either when I try to open or create a web
project. By some stange reason it never happens with my web service projects!

I've been looking for this problem around the Internet and there are many
many developers who have had this or similair problem - I can't believe why
Microsoft doesn't fix this issue. It cost me and many other developers out
there a lot of money to fix this problem each time we want to open (or in
some cases create a web project).

My computer uses Win XP SP2, IIS 5.1, VS. 2003

These are my toplist of fixes I have learn during the past year to
open/create a web project (I don't want to think about how much time I have
spent on this):

Sometimes I need to do these steps (my most common solution):
uninstall IIS
delete (rename) the inetpub directory
Make sure the "Distributed Transaction Coordinator" service is running
reinstall IIS
regsvr32 aspnet_isapi.dll
perform aspnet_regiis -i

Sometimes this is enough (very seldom - just worked a few times during last
year):
aspnet_regiis -i

A few times I have reinstalled my whole .NET environment. This usually works
if I reinstall my IIS as well.

Of course - check that the user for aspnet has enough rights.

And yes - I unistalled my zonealarm firewall - and it actually did the trick
for a couple of weeks.

This last one is my favorite - I have no ide why, but it usally does work.
This one I have to do when I must recreate my web project and move my web
pages from the old project to this one (this happens when I cant open my web
project and some of the other solutions doesn't work):

- Remove the virt dir in IIS
- IISReset
- Rename the physical path of your souce dir
- Create a new virt dir with the old path (IMPORTANT: you must create the
physical dir inside IIS - otherwise it won't work)
- Try create your new web project with the original name inside VS .NET - if
your lucky you have a new empty web project. Now we should try to move the
files from the old project...
- So start with deleting all your files from your newly created web project
- DO NOT SAVE (if you do that it will not work!)
- Then open explorer and move the files from your old project to this new
projects directory (only the source files - if you move the bin unexpected
things might happend).
- Then open your new web project file in NOTEPAD and copy the references
from the old project file and put them here. Make sure it looks ok and save
the new project file.
- Hopefully VS. NET will prompt you a windows - choose 'Discard' among the
options.
If you are lucky - you can begin to work with your project now!

Can anyone help me with this problems?
Thomas
 
J

Jeff Evans

I don't know what firewall you may be using on that machine, but my copy of
Zonealarm always causes VS.NET to throw this error when creating a new
ASP.NET web app. I kill Zonealarm and it works fine.
 
J

John Saunders

Thomas Andersson said:
Hi,

I am so so tired of getting this error message when I try to open a web
project or create a new one:

The web server reported the following error when attempting to create ot
open the web project located at the following URL: 'http://localhost/...'
A connection with the server could not be established

You gave a list of things you try to fix this, but no information on what
troubleshooting techniques you use. Given the list of fixes you've tried, I
recommend you start from scratch. I further recommend that you try keeping
this simple.

Start with: what does the IIS log say? Do you have Frontpage extensions
installed and enabled? Is this happening on existing web projects? Are these
projects all local? If so, try to keep a record of the date/time when
opening one of these projects succeeds. Then, when one fails, you can maybe
try to figure out what happened between the time it last succeeded and the
time it failed. You can also try some of the other web projects which have
succeeded in order to determine whether any of those now fail. It will be
interesting to see what the failures have in common with each other.


I used to have problems like this with VS2002. I have gotten down to a
pattern that works all of the time:

1) Create the file system folderfor the web project
2) Right-click the folder and choose "Properties"
3) Choose the Web Sharing tab
4) Enable web sharing on the default web site
5) Open or create the project


I used to go though hell with Frontpage Server Extensions and web folders
and whatever else felt right, but that just doesn't happen any more. I think
that's because I simplified things and reduced the number of different
things I was doing to my server machine. That made it more likely that I
would find the problem, not less likely.

John Saunders
 
G

Guest

As I described in my question - I unistalled my zonealarm firewall - and it
actually did the trick for a couple of weeks. Then the problem came back.

/Thomas
 
M

MattB

Thomas said:
Hi,

I am so so tired of getting this error message when I try to open a web
project or create a new one:

The web server reported the following error when attempting to create ot
open the web project located at the following URL: 'http://localhost/...'
A connection with the server could not be established

I usually fix it somehow (see my collection of solutions at the bottom of
this message) but it allways comes back with minor changes in the error
messages. And it allways comes either when I try to open or create a web
project. By some stange reason it never happens with my web service projects!

I've been looking for this problem around the Internet and there are many
many developers who have had this or similair problem - I can't believe why
Microsoft doesn't fix this issue. It cost me and many other developers out
there a lot of money to fix this problem each time we want to open (or in
some cases create a web project).

My computer uses Win XP SP2, IIS 5.1, VS. 2003

These are my toplist of fixes I have learn during the past year to
open/create a web project (I don't want to think about how much time I have
spent on this):

Sometimes I need to do these steps (my most common solution):
uninstall IIS
delete (rename) the inetpub directory
Make sure the "Distributed Transaction Coordinator" service is running
reinstall IIS
regsvr32 aspnet_isapi.dll
perform aspnet_regiis -i

Sometimes this is enough (very seldom - just worked a few times during last
year):
aspnet_regiis -i

A few times I have reinstalled my whole .NET environment. This usually works
if I reinstall my IIS as well.

Of course - check that the user for aspnet has enough rights.

And yes - I unistalled my zonealarm firewall - and it actually did the trick
for a couple of weeks.

This last one is my favorite - I have no ide why, but it usally does work.
This one I have to do when I must recreate my web project and move my web
pages from the old project to this one (this happens when I cant open my web
project and some of the other solutions doesn't work):

- Remove the virt dir in IIS
- IISReset
- Rename the physical path of your souce dir
- Create a new virt dir with the old path (IMPORTANT: you must create the
physical dir inside IIS - otherwise it won't work)
- Try create your new web project with the original name inside VS .NET - if
your lucky you have a new empty web project. Now we should try to move the
files from the old project...
- So start with deleting all your files from your newly created web project
- DO NOT SAVE (if you do that it will not work!)
- Then open explorer and move the files from your old project to this new
projects directory (only the source files - if you move the bin unexpected
things might happend).
- Then open your new web project file in NOTEPAD and copy the references
from the old project file and put them here. Make sure it looks ok and save
the new project file.
- Hopefully VS. NET will prompt you a windows - choose 'Discard' among the
options.
If you are lucky - you can begin to work with your project now!

Can anyone help me with this problems?
Thomas

You might want to try this post-sp2 hotfix:
http://www.microsoft.com/downloads/...FamilyID=17d997d2-5034-4bbb-b74d-ad8430a1f7c8

It's supposed to correct problems with the loopback adaptor introduced
with sp2.

Matt
 
G

Guest

Hej John and thank you for your reply!
You gave a list of things you try to fix this, but no information on what
troubleshooting techniques you use. Given the list of fixes you've tried, I
recommend you start from scratch. I further recommend that you try keeping
this simple.
I promise you I try to keep things as simple as possible. But it seems like
this problem can appear even if I haven't done anyhing particular.
Start with: what does the IIS log say?
Thats one thing I haven't looked at before. And here is a line from the web
project I cannot open:
17:47:18 127.0.0.1 POST /MyWebPath/_vti_bin/shtml.exe/_vti_rpc 405
What is shtml.exe??? Hmm I thought shtml.exe was a FrontPage thing? But I
don't have Frontpage Extension installed - or at least it is not checked when
I look under my IIS in the windows component dialouge...
Do you have Frontpage extensions installed and enabled?
No it should not be installed
Is this happening on existing web projects?
Currently - there is only one project I can not open! I can create new web
projects as I like, and it seems like I can open every existing web project
except one.
projects all local? If so, try to keep a record of the date/time when
opening one of these projects succeeds. Then, when one fails, you can maybe
try to figure out what happened between the time it last succeeded and the
time it failed. You can also try some of the other web projects which have
succeeded in order to determine whether any of those now fail. It will be
interesting to see what the failures have in common with each other.
These are all local web projects and I try to compare the projects why some
work and some don't. I look at the project dependencis, IIS settings, all I
can think of...
I used to have problems like this with VS2002. I have gotten down to a
pattern that works all of the time:

1) Create the file system folderfor the web project
2) Right-click the folder and choose "Properties"
3) Choose the Web Sharing tab
4) Enable web sharing on the default web site
5) Open or create the project
I will take a look at this - and add it to my "collection" if it helps ;)
I used to go though hell with Frontpage Server Extensions and web folders
and whatever else felt right, but that just doesn't happen any more. I think
that's because I simplified things and reduced the number of different
things I was doing to my server machine. That made it more likely that I
would find the problem, not less likely.

After each time I get a fix working I try to keep everything as simple as
possible, but it allways turns out to run into the same problem. And it is
only on this computer it happens! On my other computer I never experience
this problem - but there I use Win 2000.
 
G

Guest

Hi Matt,

I just tested that hotfix but that didn't help. Thank you anyway!
Thomas
 
G

Guest

You might try deleting the C:\Documents and Settings\"username"\VSWebCache
folder. (put the appropriate path in for the username).

I've had the problem off and on over the years and the last time I had it
deleting the VSWebCache seemed to fix it right up.

John
 
W

WenJun Zhang[msft]

Hi Thomas,

Could you please reproduce the create project error again in VS.net
and then collect its corresponding IIS log? I believe this can be the
start point for us to looks into the problem. Please take care
sometimes the logging will be a few mins delayed after the request.

Wait for your update.
Thanks.

Best regards,

WenJun Zhang
Microsoft Online Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
Get Secure! - www.microsoft.com/security
 
G

Guest

Hi WenJun,

Here is the complete IIS log for when I try to open the project causing the
error:

#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2004-12-10 10:42:40
#Fields: time cs-method cs-uri-stem sc-status sc-win32-status
10:42:40 GET /MyWebProject/vs-12117553629679268_tmp.htm 200 0
10:42:40 GET /_vti_inf.html 404 2
10:42:40 POST /MyWebProject/_vti_bin/shtml.exe/_vti_rpc 405 1
10:42:40 GET /_vti_inf.html 404 2
10:42:40 POST /_vti_bin/shtml.exe/_vti_rpc 405 1
10:42:46 GET /MyWebProject/get_aspx_ver.aspx 302 0
10:42:46 GET /MyWebProject/myWebPage.aspx 302 0

2 comments I've got here:
- I have no idea what the "get_aspx_ver.aspx" is. It is not in my web
directory or project!
- I have many pages in MyWebProject but it seems to stop after the
myWebPage.aspx.

Thanks
Thomas
 
H

Hans Kesting

- I have no idea what the "get_aspx_ver.aspx" is. It is not in my web
directory or project!

It's a trick that is used by vs.net to test what .net version is installed.
The file doesn't need to exist but you could add an empty file with this name.
The headers returned by IIS hold the information that is used, any content
is ignored.

Hans Kesting
 
J

John Saunders

Thomas Andersson said:
Hej John and thank you for your reply!

I promise you I try to keep things as simple as possible. But it seems
like
this problem can appear even if I haven't done anyhing particular.

Nothing in particular that you _know_ about. ;-)
Thats one thing I haven't looked at before. And here is a line from the
web
project I cannot open:
17:47:18 127.0.0.1 POST /MyWebPath/_vti_bin/shtml.exe/_vti_rpc 405

The technical term for this is "a clue".
What is shtml.exe??? Hmm I thought shtml.exe was a FrontPage thing? But I
don't have Frontpage Extension installed - or at least it is not checked
when
I look under my IIS in the windows component dialouge...

I don't know what shtml.exe is (that can be an exercise for the OP), but 405
is "Method not allowed".

I'd follow up on this if I were you.

John Saunders
 
G

Guest

Puh FINALLY - I got it!

This was definetly no bug - it was my own fault! Here is what happend:

Last day I was editing my web.config and changed the authorization element
to the "<deny users="?"/> (this was what I meant by "I haven't done anyhing
particular" - sorry). I normally don't have this line on my development
machine and I forgot to give access to one single aspx-file in my project.
Then of course when I tried to open my web project I didn't have access
rights to this file and VS prompt me my good old friend "A connection with
the server could not be established". And since I have had this error message
many times before I assumed that one of the other fixes should help me out
this time as well - but of course they didn't help in this case.

I found the problem by studying my IIS logs (thanks John!)

So this was my mistake - but I would appreciate another more informative
error message saying something like "myWebPage.aspx could not be loaded due
to your web.config settings bla bla".

Ok until next time.... thank you guys for your help!

Thomas
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top