Sounds like you want to use AOP to do this.Define your point cuts and 
voila.There is postsharp which is pretty easy to get up to speed with but I 
found the compile time twice as slow.Spring has an AOP library.I think this is 
the best approach for adding this type of thing without altering the [EMAIL 
PROTECTED]> Date: Mon, 4 Feb 2008 08:16:30 -0500> From: [EMAIL PROTECTED]> 
Subject: [ADVANCED-DOTNET] modifying code files with script.> To: 
ADVANCED-DOTNET@DISCUSS.DEVELOP.COM> > We have a pretty large codebase, pushing 
1 million lines of code.> > Every 6-8 weeks we release an update to our 
customers with new features &> bugfixes from the prior release cycle. Typically 
just after a release we> get a spike in bug reports.> I'm looking for a way to 
enhance the information in our bug reports, so we> can have our customers repro 
the problem with tracing enabled to get us a> very complete picture of the 
stack traces.> > I had the idea that i can add some instrumentation to our code 
using the> Trace.blah. So the first and last line of every method will be:> 
(pseudo code)> > Trace.Writeline ("Entering Methodname arg1Name = 
ar1Value|arg2Name => arg2Value")> Trace.Writeline ("Leaving MethodName")> > 
Using config file to enable/disable tracing.> The hard part is adding these 
lines to our existing codebase...too much> typiing for my liking.> > Does 
anyone know of an addin or existing script tool that can re-write my> code 
files using regex, codeDom, or even a Vs.net addin that can help here> and 
auto-magically insert these lines?> > Our platform is vs2008, vb.net, .Net 2.0> 
> Thanks> Phil> > ===================================> This list is hosted by 
DevelopMentor® http://www.develop.com> > View archives and manage your 
subscription(s) at http://discuss.develop.com
_________________________________________________________________
Free games, great prizes - get gaming at Gamesbox. 
http://www.searchgamesbox.com
===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to