Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2010 fails debugging: HttpException invalid file name for file monitoring in LoadControl

I've really been struggling for days on this matter.

I have migrated a asp.net 3.5 project in VS2010 to a asp.net 4 project. Everything worked fine for several weeks.

Somehow, I get a strange error since a few days. To clarify what this project looks like:

The Application

It's a UserControl based application and the app areas are composed of nested UserControl Hierarchies, that load their children Controls in OnInit(), in order to get the event system to work.

(Note: everything works great in VS2008 and .net 3.5!)

The Error

Now when I start debugging the webapplication in VS2010, sometimes (!!!), a HttpException is thrown, with the message:

Invalid file name for file monitoring.

in LoadControl()<- and now it gets interesting, the parameter for LoadControl is a ~/ prefixed UserControl-Path eg. ~/Controls/Home/Partial.ascx BUT in the Exception it is shown as a Directory, somewhere in the Controls Directory.

Probably VS uses such an approach to internally track changed files to reload?

Has anyone encountered the same issue? If so, have there been any solutions?

Edit: when deploying the webapplication, the error vanishes. It only occurs when debugging. I have currently disabled HttpExceptions in the debug->exceptions menu. But i would be very glad to catch those again too ..

like image 696
ovm Avatar asked Aug 25 '10 11:08

ovm


2 Answers

The error eventually happened again, but now i found that you can circumvent the issue by reverting the Enable Just My Code option in the Options: Tools->Options->Debugging->General, which in fact originally had introduced the broken debugging behavior.

The Option Enable Just My Code has to be set.

like image 101
ovm Avatar answered May 27 '23 15:05

ovm


I had this issue as well, and already had Enable Just My Code checked in VS. However after unchecking the option, saving settings, and then re-checking it, the issue went away.

like image 20
UnionP Avatar answered May 27 '23 15:05

UnionP