string search and replacement in aspx files

  • Thread starter Thread starter Dhanak
  • Start date Start date
D

Dhanak

I have around 1000 aspx files that contains standard lines intended
for debuggibg.Now before we put these to production we need to remove these lines.

We r currently using StreamReader and Regex Classes of .Net to do this.
Can somebody suggest any solution which can improve performance and accuracy?
 
Dhanak,

I would handle it a different way. Basically, I would have a class with
static methods that will perofrm your debugging (or logging). Then, on
those methods, I would apply the Conditional attribute in the
System.Diagnostics namespace to those methods. When in debug mode (which
you should be able to specify in the web.config file for hte app), the
methods will be compiled in. When not in debug mode, calls to those methods
with the attribute set will not be made.

For the attribute, you will want to pass the string "DEBUG", as that
corresponds to the debug flag which is set for debug builds.

Hope this helps.
 
Back
Top