【问题标题】:message in web service {"File does not exist."}`Web 服务中的消息 {“文件不存在。”}`
【发布时间】:2011-08-08 09:28:06
【问题描述】:

我有一些网络服务应用程序,并且在其中

 protected void Application_Error(object sender, EventArgs e) {

我遇到了一个例外[System.Web.HttpException] = {"File does not exist."} 这是我踏入的第一个地方。 我怎样才能获得有关缺少什么文件的更多信息? 堆栈跟随

"   at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response)\r\n   at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context)\r\n   at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)\r\n   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)"

非常感谢您的帮助

【问题讨论】:

    标签: .net web-services iis-7 asmx


    【解决方案1】:

    向 application_error 方法添加断点,然后在监视窗口中查看 Server 变量。如果你环顾四周,在不同的属性中会有不同的相对路径和绝对路径,比如

    Server 
    - Non-Public Members 
       - _context 
          - Request 
             - AppRelativeCurrentExecutionFilePath"
    

    【讨论】:

    • 我看到了 "~/" ,但没有关于缺少的文件名
    • 在我看来这就是问题所在。它指向一个目录而不是一个文件。看起来您收到的请求是“yousrsite”而不是“yoursite/myservice.asmx”
    • 所以它在某种程度上与我的应用程序的用户有关。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-21
    • 1970-01-01
    • 2012-12-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多