views:

54

answers:

1

I've taken over the code of a website from someone else to finish off and have hit the issue that every time I load a page, I get a 'File Does Not Exist' exception caught in the Application_Error handler in my Global.asax file.

I was curious what it was, so have tried creating brand new solutions with both a Web Site and Web Application, both with and without a Master Page and a single .aspx page - both had the same problem.

This is using VS2010 and .NET 3.5, on Windows 7 64-bit.

Any ideas please? The stack trace tells me absolutely nothing and the fact I'm getting it with new projects is odd.

Exception Stack Trace:

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

What is the file name in the exception? If the file name or the path is obfuscated, then you likely have a corruption in ASP.NET temporary files. Try "clean solution" and "rebuild solution" and run it again.

Otherwise, you'll need to post more information, including the full exception message, not just the call stack. Is this happening on the default page of the site? Is the web project selected as the startup project? Is this happening in the Visual Studio web server, or IIS?

Cylon Cat
The issue is there is no file name or extra info in the exception. I've posted everything I've got sorry.It tells me nothing useful. If I put halt on all exceptions on too, I get nothing - it still just hits the exception handler in the Global.asax file and nowhere else.I've also closed Visual Studio and create two brand new test solutions, as mentioned, so clean / rebuild won't help.
Michael
OK, that qualifies as pretty weird. The call stack tells me that you're in the ASP.NET pipeline, and it's setting up to load and process a page, but (probably) not having a page to load. It may be that the site doesn't know what the default page is, so perhaps you can try selecting a page and making it the default startup page. Or with the page open in Visual Studio, simply right-click on the page in the edit window and select View in Browser; this would tell you if there's a problem with the page.
Cylon Cat
Tried that thanks.It happens with any page, only when using Visual Studio. Once I deploy to my web server (Windows Server 2003 R2) it's fine and no errors.Within studio, there is a default page set, so won't be that.Odd - sounds like an issue with VS2010 - didn't do this with VS2008.
Michael
Very odd. I just tried a variety of new web applications (default content, empty) and web project (default content). In the empty project, I tried no pages at all, one page not named default, one page named default. All worked fine, so I'm not encountering the problem at all. One last thing to check: open the solution properties and project properties, and check to see that everything looks right. In particular, check the project properties, web tab, startup page options. If all else fails, try a clean install of VS2010 on another machine. Other than that, I'm out of ideas.
Cylon Cat
Thanks for suggestions - it is very odd yes. Will try what you say - other than that, I'm tempted to blitz the computer and start from scratch - it's been about 9 months since last rebuild anyhow! Must remember to take an image after installation this time!
Michael