Stylecop Code Analysis does not ignore LinqToXsdSource.cs as it should


The generated file contains many violations (~ 4600 in my case) of the code analysis rules. However, normally this file should be excluded since it contains a header as:
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
The problem is in the fact that there is a empty comment line in that header: http://stackoverflow.com/questions/5027889/exclude-file-from-stylecop-analysis-auto-generated-tag-is-ignored#comment28591940_5028308

So the line between "Runtime ... " and "Changes ..." containing the single // is cause of this behavior. Please adjust as needed since the file generates each time. For now I'll fork the source code and make the adjustment myself. Thanks


Supersymmetry wrote Jul 7, 2015 at 1:41 PM

Ok so I found out the string "This code was" does not come from the source of this project, I assume this is some MS fluke stored in an ancient class of some kind which undoubtfully, is inaccessible to me.

So there is but 1 solution: stop generating dynamic code, copy the file to the project and manually change it.

Shame.... I wonder why this stuff never gets fixed, no one uses dynamic XML in their MS solutions? Everyone uses Xsd.exe? Some other reason... dunno