I'm developing a webapplication that eventually will need to run in a shared hosting environment, thus under medium trust.
In a medium trust environment, things like System.Diagnostics.Trace.WriteLine() and System.Diagnostics.Debug.WriteLine() can't be used. Using those statements will result in security exceptions.
While developing, I make extensive use of System.Diagnostics.Trace.WriteLine() on my development server, and I need those statements in my code lateron as well to be able to see what's going on when things don't run like they should.
So taking all those statements out of my code before deploying for the production environment is not an option, as then I would have to maintain 2 versions of the code: one with and one without trace/debug statements.
I've tried putting those System.Diagnostics.Trace.WriteLine() statements in try/catch blocks, but it seems to slow down the application very much. And of course I don& ...
Go to the complete details ...