GCop is a set up code analysis rules for improving C# code.
First of all make sure you have installed visual studio 2017 version 15.5.5 or a newer one.
GCop.All.Geeks
GCop.All.Common
Note : You need to do this once for each project / solution.
If GCop throws error related to NETStandard, Please update your 'Microsoft.Net.Compilers' Package, if you are using 'Microsoft.CodeDom' please update that either.
If you disagree with any of the GCop rules, or if you believe they are not applicable to your project, you can Escape the Cop, i.e. disable it, using any of the following methods.
Unfortunately Visual Studio doesn't allow you to disable analysis rules at the solution level. But you can disable them for every project in your solution.
GCop316; GCop140; GCop179
You can disable GCop for specific C# classes by adding the [EscapeGCop]
attribute on top of it. You can optionally provide a reason description as well. This is particularly useful for auto-generated code.
Note : For having EscapeGCop, you need to install MSharp or Olive from NuGet for each project or solution as well.
For example:
[EscapeGCop("This class is auto generated.")]
public class MyClass
{
...
}
You can disable GCop for specific methods by adding the [EscapeGCop]
attribute on top of it. For example:
...
[EscapeGCop("It's not applicable because ....")]
public void SomeMethod()
{
...
}
...
You should use it in the following scenarios:
As this documentation is a kind of Open-Doc, contributions are welcome. We are currently focused on documenting GCop errors. Feel free to review, contribute and pull request to this documentation. we'll review your PR as soon as we can and we will do the merge if everything was just fine. If there was any kind of issues, please post it in the issues section. Make sure that you follow our writing styles.
This project is maintained and supported by the GeeksLtd.
See also the list of contributors who participated in this project.