vb.net ASP .Net 页面无法显示错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18839409/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 15:05:40  来源:igfitidea点击:

ASP .Net Page Can't Be Displayed Error

asp.netvb.netvisual-studio-2008windows-7-x64

提问by Dima

I am having the strangest issue. My website has been working perfectly in Visual Studio 2008 until I tried to work on the website in Visual Studio 2012. Having abandoned that idea, I am now back to Visual Studio 2008 with the following problem.

我遇到了最奇怪的问题。我的网站一直在 Visual Studio 2008 中完美运行,直到我尝试在 Visual Studio 2012 中的网站上工作。放弃了这个想法,我现在回到 Visual Studio 2008 并遇到以下问题。

Problem:

问题:

Any page inside any folder displays a "Page can't be displayed" error or similar in all browsers (IE, Firefox, Chrome, Safari) UNLESSthe page is a Default.aspx page. Break points do not load for any of the pages having problems, although debugging is enabled in Web.config. There are no errors in the event viewer.

任何文件夹中的任何页面在所有浏览器(IE、Firefox、Chrome、Safari)中都会显示“无法显示页面”错误或类似错误,除非该页面是 Default.aspx 页面。尽管在 Web.config 中启用了调试,但不会为任何有问题的页面加载断点。事件查看器中没有错误。

Possible reason for problem:

问题的可能原因:

  • I tried working on the website in Visual Studio 2012. After it didn't recognize any of the imports, etc., I decided to just continue using Visual Studio 2008.
  • I also deleted all of the files and folders in my %temp% directory
  • 我尝试在 Visual Studio 2012 中的网站上工作。在它无法识别任何导入等之后,我决定继续使用 Visual Studio 2008。
  • 我还删除了 %temp% 目录中的所有文件和文件夹

What I've tried:

我试过的:

  • Create a new blank page in any folder to see if it will display; the page has the same error
  • Comment out all code on an existing non-Default.aspx page; same problem
  • Check the hosts file; nothing is active and other changes I've made had no effect
  • Browse to another page from Default.aspx; same problem "Page can't be displayed"
  • Checked for new AV, malware, etc. software recently installed; none installed
  • Created a new site on the same machine to see if new site will have the same problem. New site works just fine.
  • Cleared out the contents of C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files; no change
  • 在任意文件夹新建一个空白页,看是否会显示;该页面有相同的错误
  • 注释掉现有非 Default.aspx 页面上的所有代码;同样的问题
  • 检查主机文件;没有任何活动,我所做的其他更改无效
  • 从 Default.aspx 浏览到另一个页面;同样的问题“页面无法显示”
  • 检查最近安装的新 AV、恶意软件等软件;没有安装
  • 在同一台机器上新建一个站点,看看新站点是否会出现同样的问题。新网站运行良好。
  • 清除 C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files 的内容;没变

Environment:

环境:

  • Visual Studio 2008 on Windows 7 x64. The backend is in VB .Net
  • Running on the developer machine using ASP .Net Development Server
  • Windows 7 x64 上的 Visual Studio 2008。后端在 VB .Net 中
  • 使用 ASP .Net Development Server 在开发者机器上运行

Any and all help is appreciated.

任何和所有的帮助表示赞赏。

Thank you.

谢谢你。

采纳答案by Dima

So, I figured it out. Essentially, I was redirecting all but the Default.aspx pages to https (inside Global.asax). While this works on the production server that has valid certs, on the development machine, all one gets is the aforementioned behavior. Thank you all for the comments and suggestions.

所以,我想通了。本质上,我将除 Default.aspx 页面之外的所有页面重定向到 https(在 Global.asax 内)。虽然这适用于具有有效证书的生产服务器,但在开发机器上,所得到的只是上述行为。谢谢大家的意见和建议。

回答by live-love

Had the same error.

有同样的错误。

Turning customErrors Off worked for me.

关闭 customErrors 对我有用。

In web.config:

在 web.config 中:

<customErrors mode="Off" defaultRedirect="ErrorPage.aspx" ...>

回答by James

In my case, Dropbox happened to be using the same port (49210). Fixed my issue by terminating the conflicting application. Alternately, change the port under the Project's properties.

就我而言,Dropbox 碰巧使用了相同的端口 (49210)。通过终止冲突的应用程序解决了我的问题。或者,更改项目属性下的端口。