Visual Studio unable to open Web site error

2020-07-22 19:46发布

问题:

I work with Visual Studio 2008 and work on a web project which contains a web site. When opening the solution file, I receive the error message: "Unable to open the Web site http://localhost/myWebsite.de. The Web site http://localhost/myWebsite.de does not exist." I can see the web site greyed out, with the remark "unavailable", in the solution folder.

It is possible to add the web site to the solution, but after relaunching Visual Studio, it´s gone again.

Has anyone had this problem in a similar way?

回答1:

Open the existing Solution file using notepad, Copy the actual project Directory path and update the solution file content with respect to following options alone

Debug.AspNetCompiler.PhysicalPath = "update the path here"
Release.AspNetCompiler.PhysicalPath = "update the path here"
SlnRelativePath = "update the path here"

leave the remaining config untouched



回答2:

I think KB 326497 has your answer. Setting up an IIS virtual directory to point to the location the site is running from corrected this error for me.



回答3:

Question was probably not general enough to answer it... Must have been some problem with my SourceSafe, after I copied the web site to a local folder, I had no problems any more.



回答4:

Please Check with the host file located in "C:\Windows\System32\drivers\etc" directory. There might be chances for redirecting localhost to some other host environment by you or someone else. If you remove the line for localhost configuration it will work for you.