Pregunta

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 ?

¿Fue útil?

Solución

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.

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top