English 中文(简体)
StyleCop SA1636 rule firing when it should not
原标题:
  • 时间:2009-11-06 17:24:18
  •  标签:
  • stylecop

We are using Resharper 4.5 and StyleCop 4.3.

We have a project with many .CS files in it. All .CS files have valid headers, as defined by our StyleCop settings, and added automatically by Resharper s Insert/replace header action.

Four of the .CS files receive a SA1636 warning. The copyright text exactly matches the declared copyright text from the settings file.

Has anyone else experienced this problem? Is there any kind of diagnostic logging that we can enable or otherwise use to help determine why this one rule appears to be mis-firing?

问题回答

Check the encoding format using something like notepad or visual studio Save As - mine was encoding with the wrong character set.

In case @Adrian s answer didn t work for you, this one will:

  1. Right click over StyleCop.json
  2. Click on Properties
  3. Change the build action to C# analyser additional file :

Choose C# analyzer additional file instead of None

Credits to Peter Morlion: https://blog.submain.com/stylecop-detailed-guide/





相关问题
Stylecop vs FXcop

Has Stylecop superseded FXcop? Which product should we be using with Visual Studio 2008?

Setting up StyleCop for team development

We are trying to setup stylecop for a team development environment. So far what we have done is: Checked the files into source control Create an environment variable on every machine that points to ...

Is there a planned StyleCop release for VS 2010?

Does anyone know when stylecop will be released to integrate into VS2010. I know you can tweak the config files to integrate it at the moment, but it is not possible to view the UI.

StyleCop Visual Studio Snippets

I m looking for some Visual Studio snippets for implementing style cop rules. For instance when style cop returns an error saying my code needs a documentation header it would be useful to have a ...

StyleCop for ReSharper

I like stylecop and we use it to enforce coding standards. I dont like the fact that there is no way to automatically fix problems. So was thinking of making a plugin. Once I realised that 2010 is ...

StyleCop SA1636 rule firing when it should not

We are using Resharper 4.5 and StyleCop 4.3. We have a project with many .CS files in it. All .CS files have valid headers, as defined by our StyleCop settings, and added automatically by Resharper ...

热门标签