使用.NET CodeDom代码生成时,如何自定义自动生成的注释?

Not*_*Dan 13 .net c# code-generation

我正在使用CodeCompileUnitCSharpCodeProvider生成一些源代码.它将下面的标题添加到所有生成的代码中.有没有办法自定义评论,所以它说了别的什么?

// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3053
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
Run Code Online (Sandbox Code Playgroud)

Joe*_*eau 6

你不能.我建议在此之后立即添加您自己的评论.以下是如何执行此操作的示例:http://www.codeproject.com/KB/dotnet/ResourceClassGenerator.aspx