Search code examples
asp.netvisual-studio-2012stylecopresource-files

Resource Designer Files - Change Template


When changing a localized resource file, such as resources.de.resx the designer code gets regenerated blank.

How can I change this to be the auto generated code message?

I.e.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.17929
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

The lack of the auto-generated code message is causing it to be picked up by Code Analysis / Source Analysis and putting it back after every edit is starting to become irratating.


Solution

  • Add a StyleCop.Settings file to the project and uncheck the analyise designer files and StyleCop will ignore the resource.de.designer.cs file.