.net - 发生 HttpException : File does not exist

标签 .net asp.net silverlight visual-studio-2010

我有一个 Silverlight/ASP 托管应用程序。当我开始时,我得到错误:

HttpException occurred

File does not exist.

这是昨天才开始发生的,我不知道为什么。它甚至没有访问我的代码,只是以 WebHost.Host.ProcessRequest 开头的内部调用。

运行VS2010,应用是.NET 4.0

如果有任何帮助,我将不胜感激 - 我有真正的错误要尽快修复!

干杯, 丹尼尔

最佳答案

知道了,方法如下:

Run the app and immediately get the error

Turned on Call Stack Window (Debug->Windows->Call Stack)

Top of the stack is a call to System.Web.StaticFileHandler.GetFileInfo

Went to Locals Window (Debug->Windows->Locals) did not see anything meaningful there

Went up the stack once to ProcessRequestInternal

Looked in Locals Window, opened up variable called "context" browsed through properties... in ConfigurationPath I see a path to a file: /ClientBin/Images/pclogo.png

Sure enough, that image file not there!

Copy the file, and all is well. Whew!

接下来只需要通过确保图像被视为内容来修复项目。尽管如此,要找到一个明显的常见错误还是很费劲。

关于.net - 发生 HttpException : File does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6128733/

相关文章:

.Net DriveInfo() 与 UNC 路径?

c# - 为什么突然一个线程运行一个方法的一部分?

c# - ASP.NET Grid中的jquery幻灯片效果

asp.net - 孤立的 RazorEngine 无法将模型传递到不同的 AppDomain

.net - 列出运行时从开放泛型类型创建的封闭类型

c# - 支持按钮保持的 ASP.NET NumericUpDown Extender?

ASP.NET 云应用与普通 ASP.NET

c# - 如何避免在替换所有元素或添加元素集合时多次触发 ObservableCollection.CollectionChanged

wpf - 许可 WPF、Silverlight 和 WP7 程序集

wpf - 将合并词典添加到合并词典中