1
我正在使用Visual Studio 2015以及NuGet包StyleCop分析器进行代码分析。当我运行代码分析时,我也收到了由实体框架生成的类自动生成的代码或添加的服务引用的警告。使用StyleCop分析器的Visual Studio 2015代码分析
我生成的文件头部包含
//-----------------------------------------------------------------------
// <copyright company="SomeCompany" file="MyFile.cs">
// Copyright © Some Company, 2011
// </copyright>
// <auto-generated />
//-----------------------------------------------------------------------
或
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
在项目中,我可以选择“禁止从生成代码的结果”启用
,如何排除我代码分析生成的代码?
注释是肯定不够好跳过,它需要[GeneratedCode] ATTRIB UTE。 –