Can I use VS2010 to generate a bunch of code and stuff it in a file as a pre-build step?
I have a bunch of those [assembly:] attributes to generate.. I need one in the 开发者_运维百科assemblyInfo.cs file for each class in a certain directory of my project. The trouble is there's going to be hundreds of these classes eventually. I need to do this automatically. Thankfully, these attributes differ only by the class name, so I could easily generate them with code.
I don't think you can add these attributes at run-time so I need to do it in compile time.
Is there a feature in VS-2010 that allows me to generate a block of [assembly:] attributes and stuff them in the assemblyinfo.cs file before the project compiles?
Would something like T4 Templating Engine help?
精彩评论