开发者

Can I use VS2010 to generate a bunch of code and stuff it in a file as a pre-build step?

开发者 https://www.devze.com 2023-03-31 02:26 出处:网络
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

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消