Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net debug directory monitoring HttpException

When I start my ASP.Net 4.0 web app in debug mode, I'm getting the following exception:

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: 

The thing is, the file this is pointing to IS a directory, so why does Visual Studio 2010 think it's a file? I'm running this on IIS 7 on my local machine

like image 931
Brad Urani Avatar asked Oct 13 '10 16:10

Brad Urani


3 Answers

The good news: it doesn't seem to have any knock-on effects

The bad news: I haven't figured out the cause or a solution

The workaround: Disable break-on-exception for HttpException (Debug->Exception), and filter these out in your logs. You can still capture other HttpException in debug mode by placing a breakpoint in Application_Error (if you have implmented it - but you should have anyway)

like image 196
Vroomfundel Avatar answered Oct 24 '22 00:10

Vroomfundel


I faced the same problem and by checking the Enable Just My Code checkbox option in the Options: Tools->Options->Debugging->General, I got it working.

like image 27
Atty Avatar answered Oct 24 '22 00:10

Atty


I had similar exception when I am troubleshooting HttpException arising in Application_Error itself while redirecting to Error/Index action. I had to uncheck HttpException in Debug > Exceptions dialog to remove this error. Then it redirected to Error/Index as expected without any side-effects from this mysterious exception. At that time Visual studio is in debugging mode.

like image 3
Anil Vangari Avatar answered Oct 24 '22 00:10

Anil Vangari