ASP.Net调试目录监控HttpException

标签 asp.net debugging httpexception

当我在 Debug模式下启动 ASP.Net 4.0 Web 应用程序时,出现以下异常:

System.Web.HttpException occurred
  Message=Invalid file name for file monitoring: 'C:\src\main-232\src\ZNode\Znode_MultiFront\Web\Controls\Cat5\Navigation'. Common reasons for failure include:
- The filename is not a valid Win32 file name.
- The filename is not an absolute path.
- The filename contains wildcard characters.
- The file specified is a directory.
- Access denied.
  Source=System.Web
  ErrorCode=-2147024809
  WebEventCode=0
  StackTrace:
       at System.Web.DirectoryMonitor.AddFileMonitor(String file)
  InnerException: 

问题是,this 指向的文件是一个目录,那么为什么 Visual Studio 2010 认为它是一个文件呢?我在本地计算机上的 IIS 7 上运行此程序

最佳答案

好消息:它似乎没有任何链式 react

坏消息:我还没有找出原因或解决方案

解决方法:禁用 HttpException 的异常中断(调试->异常),并在日志中过滤掉这些异常。您仍然可以通过在 Application_Error 中放置断点来捕获 Debug模式下的其他 HttpException(如果您已经实现了它 - 但无论如何您都应该这样做)

关于ASP.Net调试目录监控HttpException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3925689/

相关文章:

.net - 如何在全局 asax 中获取用户名?

c# - 如何在编译时根据 C# 中的标志更改代码

debugging - elisp `trace-function` 不产生跟踪

android - 简单 HttpPost 上的 NullPointerException

c# - Repeater 中的 CustomValidator

asp.net - System.Linq.Dynamic不支持OrderByDescending (“someColumn”)?

c# - 有没有办法通过jquery将文本发送到aspcontrol

javascript - 为什么在尝试迭代图像列表时不会删除指定的图像?

c# - 如何从 HttpRequestException 获取 StatusCode?

python - 等待来自 URL : HTTPException 的 HTTP 响应时超出截止日期