altcode.gendarme 2021.5.28.12260-pre-release

This is a prerelease version of altcode.gendarme.
There is a newer prerelease version of this package available.
See the version list below for details.
Install-Package altcode.gendarme -Version 2021.5.28.12260-pre-release
dotnet add package altcode.gendarme --version 2021.5.28.12260-pre-release
<PackageReference Include="altcode.gendarme" Version="2021.5.28.12260-pre-release" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add altcode.gendarme --version 2021.5.28.12260-pre-release
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: altcode.gendarme, 2021.5.28.12260-pre-release"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install altcode.gendarme as a Cake Addin
#addin nuget:?package=altcode.gendarme&version=2021.5.28.12260-pre-release&prerelease

// Install altcode.gendarme as a Cake Tool
#tool nuget:?package=altcode.gendarme&version=2021.5.28.12260-pre-release&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


A Mono.Gendarme fork, built against a recent Mono.Cecil version, one that can load assemblies built with current compilers.


  • Can load .net core assemblies
    • Will search the nuget cache for dependencies, though this can take some time as an alternative to using dotnet publish to get all the code you want to analyse in one place.
  • Will load debug information from embedded symbols or actual .pdb files if available even on non-Windows platforms.
    • The main impact is that the AvoidLongMethodsRule works by LoC and not IL against .net core code on all platforms.
  • Because they use obsolescing functions not present in netstandard2.0 the following Gendarme.Rules.Security.Cas rules are not implemented in the global tool version (so if this is relevant to you, use the .net Framework build):
    • AddMissingTypeInheritanceDemandRule
    • DoNotExposeMethodsProtectedByLinkDemandRule
    • DoNotReduceTypeSecurityOnMethodsRule
    • SecureGetObjectDataOverridesRule
  • The obsolete Gendarme.Rules.Portability.MonoCompatibilityReviewRule is not implemented in this fork.
  • DefineAZeroValueRule does not trigger for non-int32 enums that have a suitably typed zero value. This rule should not also be doing the job of EnumsShouldUseInt32Rule
  • Due to IL changes UseIsOperatorRule has been tuned to avoid false positives at the cost of missing some failure cases

Known Issues

Not all the classic Gendarme unit tests currently pass. In the main, these failures are due to the Roslyn compiler producing different IL than the original C# compiler did. A few failures are due to the API changes in .netstandard compared with the .net Framework. In production these will typically manifest as false negatives.

Changes made for F# support

The F# compiler generates a large amount of code that does not conform to these rules, particularly with closures. A full list for the most recent release is presented here.


Build AppVeyor Build status Build history
GitHub CI Build history

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

# 2021.5.28.12xxx-pre-release

Issues found in use
* Don't apply DoNotDeclareVirtualMethodsInSealedTypeRule to F# closures in addition to existing type exemptions

For previous releases, go here --
Since this is a release from a fork, [issues should be reported at my related repo]( that contains a Fake driver for the Gendarme tool, but noted as being against the forked Gendarme tool itself.