I want to create a custom MSBuild task that changes my .cs files before they are compiled by csc.exe (but, of course, that doesn't modify them in place - I don't want actual source files touched). I am aware of PostSharp and other AOP frameworks for .NET and they are not an option for this particular project, plus I'd like to learn how to do this.
What precisely do I have to do to get this to work?
Thanks Richard
Given your restrictions I think you can do the following:
The step 4 ensures that the files that are eventually compiled are the ones that were changed by your custom task.
You will heavily rely on the ITaskItem interface for the job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With