如何使用.NET codeDOM code世代当我自定义自动生成评论? [英] How do I customize the auto-generated comment when using .NET CodeDom Code Generation?

查看:173
本文介绍了如何使用.NET codeDOM code世代当我自定义自动生成评论?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 codeCompileUnit CSHARP codeProvider 生成一些源$ C ​​$ C。它增加了下面所有生成的code头。有没有一种方式,以便它说别的东西?

自定义评论

  //<自动生成>
//这个code是由工具生成。
//运行时版本:2.0.50727.3053
//
//更改此文件可能会导致不正确的行为,如果将丢失
//在code再生。
//< /自动生成>
 

解决方案

您不能。我建议在此之后一出,立即加入自己的评论。以下是如何做到这一点的例子:<一href="http://www.$c$cproject.com/KB/dotnet/ResourceClassGenerator.aspx">http://www.$c$cproject.com/KB/dotnet/ResourceClassGenerator.aspx

I'm using CodeCompileUnit and CSharpCodeProvider to generate some source code. It adds the header below to all generated code. Is there a way to customize the comment so it says something else?

// <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>

解决方案

You can't. I recommend adding your own comment immediately after this one. Here's an example of how to do that: http://www.codeproject.com/KB/dotnet/ResourceClassGenerator.aspx

这篇关于如何使用.NET codeDOM code世代当我自定义自动生成评论?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆