【问题标题】:Resharper file header is double commentedResharper 文件头被双注释
【发布时间】:2013-02-27 16:14:24
【问题描述】:

有什么办法可以防止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

【问题讨论】:

  • 您想要/需要的任何特殊原因?
  • 您的标题模板中是否有注释符号 (//)?如果是这样,也许您只需要删除它们?
  • 我将模板添加到问题中。

标签: c# resharper


【解决方案1】:

你应该创建没有//的模板,它应该只包含

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-29
    • 2013-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多