Resharper文件头是双重注释

时间:2013-02-27 16:14:25

标签: c# resharper

有没有办法防止Resharper插入的文件头被双重注释。

我正在使用默认文件头模板,并在代码清理中启用了“插入文件头”。

(Resharper版本7.1.2)

// #region Copyright © 2013 xxx Systems, Incorporated
// //
// // All rights are reserved. Reproduction or transmission in whole or in part, in
// // any form or by any means, electronic, mechanical or otherwise, is prohibited
// // without the prior written consent of the copyright owner.
// //
// // Filename: xxx.cs
// // Date:     27/02/2013
// // Author:   xxx
// // 
// #endregion

以下是模板:

#region Copyright © $CURRENT_YEAR$ xxx Systems, Incorporated
//
// All rights are reserved. Reproduction or transmission in whole or in part, in
// any form or by any means, electronic, mechanical or otherwise, is prohibited
// without the prior written consent of the copyright owner.
//
// Filename: $FILENAME$
// Date:     $CURRENT_DAY$/$CURRENT_MONTH$/$CURRENT_YEAR$
// Author:   $USER_LOGIN$
// 
#endregion

1 个答案:

答案 0 :(得分:6)

您应该在没有//的情况下创建模板,它应该只包含

All rights are reserved. Reproduction or transmission in whole or in part,
any form or by any means, electronic, mechanical or otherwise, is prohibited
without the prior written consent of the copyright owner.

Filename: $FILENAME$
Date:     $CURRENT_DAY$/$CURRENT_MONTH$/$CURRENT_YEAR$
Author:   $USER_LOGIN$

然后在“将文件标题包含到名称中的区域”字段中(在文件模板下面),您应该写

Copyright © $CURRENT_YEAR$ xxx Systems, Incorporated