visual-studio Visual Studio 无法打开网站错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2666133/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio unable to open Web site error
提问by AGuyCalledGerald
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.dedoes not exist." I can see the web site greyed out, with the remark "unavailable", in the solution folder.
我使用 Visual Studio 2008 并处理包含网站的 Web 项目。打开解决方案文件时,我收到错误消息:“无法打开网站http://localhost/myWebsite.de。网站http://localhost/myWebsite.de不存在。” 我可以在解决方案文件夹中看到网站变灰,并带有“不可用”的注释。
It is possible to add the web site to the solution, but after relaunching Visual Studio, it′s gone again.
可以将网站添加到解决方案中,但在重新启动 Visual Studio 后,它又消失了。
Has anyone had this problem in a similar way?
有没有人以类似的方式遇到过这个问题?
回答by Pranesh Janarthanan
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
保留其余配置不变
回答by Colin Johnson
回答by AGuyCalledGerald
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.
问题可能不够笼统,无法回答... 一定是我的 SourceSafe 有问题,在我将网站复制到本地文件夹后,我再也没有问题了。
回答by Prasad Kambhammettu
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.
请检查位于“C:\Windows\System32\drivers\etc”目录中的主机文件。您或其他人可能有机会将 localhost 重定向到其他主机环境。如果您删除 localhost 配置的行,它将为您工作。

