Forum C# Whitelist System.Diagnostics?

Whitelist System.Diagnostics?

Postby dsaunder » September 22nd, 2011, 5:48 am

I was wondering if we could get System.Diagnostics whitelisted? Maybe for dev server only?

Specifically, I'm trying to make a wrapper for ErrorLog and I want to break in the debugger whenever an error occurs in debug only to be able to walk up the callstack:

void WriteError( string strError, Exception exception )
{
// Pass the error to PlayerIO
PlayerIO.ErrorLog.WriteError( strError, exception );
#if DEBUG
System.Diagnostics.Debugger.Break();
#endif
}

I don't like the fact that trying to use non-whitelisted codez is a fatal error. What would be AWESOME is if non-whitelisted code could be used WITHOUT being fatal in Debug, but be a fatal error in Release. This way I don't have pollute the forums with 1000 posts begging for different things to be whitelisted to ease development :D

Eh?

-D
dsaunder
 
Posts: 23
Joined: July 22nd, 2010, 7:28 am

Re: Whitelist System.Diagnostics?

Postby Henrik » September 24th, 2011, 11:48 am

Add <add key="DisableCodeScan" value="true" /> to the app.config of the gameserver project, and you can do whatever. :-)
User avatar
Henrik
.IO
 
Posts: 570
Joined: January 4th, 2010, 1:53 pm

Re: Whitelist System.Diagnostics?

Postby dsaunder » December 16th, 2011, 12:15 am

This doesn't work for me because I need a constant reminder that I can't use static data :D

Is there any way to disable exceptions printing to the console and just make them break in the debugger?
dsaunder
 
Posts: 23
Joined: July 22nd, 2010, 7:28 am


Return to C#