customErrors remoteOnly to intranet machine?

J

Joel Barsotti

Hi,

I have a local development enviroment and I'd like to be able to get the
actual asp.net error messages when I have issues and not have to flip the
web.config file around to do it. My local webserver is running on a
seperate machine than my development machine, there has to be a way to have
ASP.net consider my development machine a "local machine" and provide error
messages to it.

Thanks,
Joel Barsotti
 
J

jasonkester

You could use the oldskool hack of sniffing for IP addresses in your
error handler. Flip your custom error handler to show for all cases.
Teach it to display full stack traces to localhost and your dev
machine's IP address, and friendly messages to everybody else.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 
J

Joel Barsotti

Yeah I suppose that wouldn't be a horrible way of handling it. I was
hoping for a more elegant solution.

Maybe in .net 2.0
 
J

jasonkester

Yeah. There is nothing elegant to be found in hardcoded IP addresses!
Be sure to add a full paragraph of explaination & apology comments
above it!

// HACK: Please forgive me for the blasphemy that is to follow. We
really need to come
// up with a better way to pull this off, but for now it's at least
effective. Remember to
// modify this whenever we add a new dev box or...
// [...and another 6 lines of explanation & possibly a #warning to make
it stand out...]
if (Request.UserHostAddress == "127.0.0.1" || Request.UserHostAddress
== "192.168.1.112"...)


Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top