views:

26

answers:

2

Hi,

Does anyone have any idea how to disable asp.net custom errors only for a specific ip address? this will ease debugging exceptions on my server from my office..

Thanks in advance

A: 

Instead of messing around with IPs you can make the custom errors only be displayed when being debugged locally. Check here, look at the mode attribute.

m.edmondson
Problem is I am not debugging locally
Eytan Levit
So you are debugging code on the server? And reloading the live site as you make them to check your changes?
m.edmondson
A: 

Frankly I am not aware of anything inbuilt. But If I were to solve this, I would add a HttpModule and hookup event handler for Application_Error event and in that handler I would try to find who is the client and what to do with it further.

Subhash Dike
So you would then compare the IP address to the subnet mask in order to determine if the request originated from outside the network?
m.edmondson
@eddy556 - No, I was not thinking of that complicated. Something simple like Request.UserHostAddress will get me the host, and then we also have to remembers, that he is pretty clear about for which server he want to prevent the address, so we can check if the address is same as local, then dont raise the error. Please correct me if this is not appropriate.. I would also learn..
Subhash Dike