我有一个 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!

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


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!