Stylecop puts a copyright message when new file is created. Sample message is specified below

// -----------------------------------------------------------------------
//
// TODO: Update copyright text.
//
// -----------------------------------------------------------------------

I want to include company name, and default message (instead of update the copyright text).

How to customize the above message ?

有帮助吗?

解决方案

Open the StyleCop settings dialog (in the project context menu), and configure your company details in the Company Information tab. This will add the following settings to the Settings.StyleCop file:

<AnalyzerSettings>
    <StringProperty Name="CompanyName">Company</StringProperty>
    <StringProperty Name="Copyright">Copyright</StringProperty>
</AnalyzerSettings>

Then if required you can configure the ReSharper StyleCop settings (in the ReSharper Code Cleanup options) to either leave the header alone, insert it if missing, update the copyright info, or replace the header completely.

其他提示

ReSharper doesn't do this by default. You either installed StyleCop (then your question should be about StyleCope), or changed some options.

Normally you change file header here: ReSharper | Options -> Code Editing | File Header Text

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top