views:

167

answers:

6

I've been looking for a while for this, and having been thinking about creating it myself, but hadn't got the feeling I knew the right point to start.

I would like to have a link on the Yellow Screen that would directly jump to the correct line in Visual Studio. Anyone seen this or done this?

If it needs another error page, is it possible to replace the standard yellow screen for a whole webserver instead of per application?

Thanks.

+1  A: 

You would probably need to embed an ActiveX control in the page for something like that to be possible.

Eric Z Beard
A: 

The yellow screen of death is served by the default ASP.NET HTTPHandler.

In order to intercept it, you would need to add another HTTPHandler in front of it that intercepts all uncaught exceptions.

At that point, you could do whatever you want for your error layout.

Creating a way to directly jump to Visual Studio would be tricky. I could see it done in IE via a COM/ActiveX object.

FlySwat
A: 

The easiest, laziest thing I could think of would be to have the process happen thusly:

  1. The yellow screen is modified so the line is source code is clickable. When clicked it delivers a small text file with the source file name and line number.
  2. A small program on the PC is tied to the extension of the small file the yellow screen let you download. The program uses visual studio's extensibility model to open the source file and goto that line. The program may need to know where your source code is.

A simple Google search gives helpful pointers on how to manipulate VS with an external program such as this post on MSDN.

If you want to go snazzier, then there are certainly other methods, but I'd rather write out a quick and dirty program, and get it out of my way so I can be about my business.

Don't let the tools become projects...

Adam Davis
A: 

The yellow screen of death is just a 500 error as far as the server is concerned, you can redirect to a custom screen using the error section of the web.config. To make a whole server change in the same manner you could probably override it at the iis level? Or perhaps even set the default behaviour in the machine.config file (not 100% sure about that one though)

jonezy
A: 

The yellow screen of death is just a 500 error as far as the server is concerned, you can redirect to a custom screen using the error section of the web.config. To make a whole server change in the same manner you could probably override it at the iis level? Or perhaps even set the default behaviour in the machine.config file (not 100% sure about that one though)

If you let it bubble up all the way to IIS you will not have any way to access the Exception information. Its better to catch the Exception before the YSOD and serve your own.

This can be done at the application level.

FlySwat
A: 

Don't forget that you need the Program Debug Database (pdb) file to find the source code line number. An application in release mode won't have the same level of information as a debug release.

Daniel Pollard