{"id":24278475,"url":"https://github.com/stevegilham/altcode.dixon","last_synced_at":"2026-07-03T05:32:55.429Z","repository":{"id":80554718,"uuid":"246571322","full_name":"SteveGilham/altcode.dixon","owner":"SteveGilham","description":"FxCop rule extensions and related","archived":false,"fork":false,"pushed_at":"2023-12-18T07:56:43.000Z","size":273,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T00:57:38.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SteveGilham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-11T12:57:16.000Z","updated_at":"2022-01-08T13:09:35.000Z","dependencies_parsed_at":"2023-12-18T08:51:14.069Z","dependency_job_id":null,"html_url":"https://github.com/SteveGilham/altcode.dixon","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveGilham%2Faltcode.dixon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveGilham%2Faltcode.dixon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveGilham%2Faltcode.dixon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveGilham%2Faltcode.dixon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SteveGilham","download_url":"https://codeload.github.com/SteveGilham/altcode.dixon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242023214,"owners_count":20059301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-16T00:48:42.074Z","updated_at":"2026-07-03T05:32:55.417Z","avatar_url":"https://github.com/SteveGilham.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# altcode.dixon\nFxCop v18 (Visual Studio 2026) rule extensions and related code.  A project named for that well known police constable of yesteryear.  Intended for use with F#, since we don't have Roslyn analyzers there.\n\n## Features\n### FxCop for `netstandard2.0`\n\nAn executable, `DixonCmd.exe` that injects a `netstandard2.0` compatible platform definition into the `FxCopCmd` process and launches an analysis session.\n\n### FxCop extra rules\n* `JustifySuppressionRule` (`Dixon.Design#DX0001`), the \"Hello, World!\" of FxCop rules.  A port of the well travelled example rule to ensure that `SuppressMessage` attributes include a justification.  See e.g. http://www.binarycoder.net/fxcop/html/ex_specifysuppressmessagejustification.html\n* `ReraiseCorrectlyRule` (`Dixon.Design#DX0002`) : only `throw` an exception you've just created\n\n## Never mind the fluff -- How do I use this?\n\nThe package contains a subfolder `tools` which contains everything, including a further subfolder `Rules` containing just the rules assembly.\n\n* Copy FxCop from under Visual Studio to some (`.gitignore`d as required) location within your project. \n* Copy the Dixon NuGet package `tools` folder into the same directory as above (or just the `Rules` subfolder into the `Rules` subfolder if `netstandard2.0` support isn't relevant; or omit the `Rules` subfolder if those are not wanted)\n* Copy the `FxCopCmd.exe.config` to `DixonCmd.exe.config` if `netstandard2.0` support is desired.\n* You may need to copy the `FSharp.Core.dll` assembly from `tools` anyway if you're not an a machine with F# development -- do this if there's an obvious failure to load because it's not there.\n\nNow for framework assemblies use `FxCopCmd.exe` as before from the new location, where it will pick up the Dixon rules.  For `netstandard2.0` assemblies, use `DixonCmd.exe /platform=\u003cpath to DotNet sdk ref subfolder containing netstandard2.0.dll\u003e` e.g. `DixonCmd.exe \"/plat:C:\\Program Files\\dotnet\\sdk\\6.0.101\\ref\"`\n\n### Finding the Dixon parts\n\nI've used a dummy `.csproj` to install tooling packages that aren't `dotnet tool` items (things like unit test console runners for .net Framework, or PowerShell modules such as Pester) to a non-cache location using `dotnet restore --packages`\n\nYour build script can parse the `.csproj` as XML to find the version under the `altcode.dixon` folder\n\n### Finding the FxCop tool\n\nIt's at `%ProgramFiles\\Microsoft Visual Studio\\2022\\\u003cedition\u003e\\Team Tools\\Static Analysis Tools\\FxCop` or\n`%ProgramFiles(x86)\\Microsoft Visual Studio\\2019\\\u003cedition\u003e\\Team Tools\\Static Analysis Tools\\FxCop`; to automate the process in your build scripts, it's simplest to use the `BlackFox.VsWhere` package --\n\n* `BlackFox.VsWhere.VsInstances.getAll()` to get installed versions\n* select one of those with `InstallationVersion` property major version 16 or 17 as appropriate to your process\n* FxCop is in folder `Team Tools/Static Analysis Tools/` beneath the `InstallationPath` property\n\n### Running the DixonCmd tool\n\nAs well as needing the path of the `netstandard2.0.dll` in the build environment, the process will need to be fed with the non-platform dependencies through the `/d:` command line argument e.g.\n```\n\"/d:\u003cnuget cache\u003e/packages\\\u003cpackage name\u003e/\u003cpackage version\u003e/lib/netstandard2.0\"\n```\n\nSome dependency lacks will be obvious from the error messages, but some are subtle and need to be deduced from the exception details in the FxCop report file.  In particular it may be necessary to add .net Framework 4.7.2 (or at least its reference asseblies to handle resolution failures with obvious platform functionality)\n\n### In greater detail\n\n[Here's the recipe I use](https://github.com/SteveGilham/altcode.dixon/wiki), including appropriate sections of `Fake.build` scripting.\n\n## Developer/Contributor info\n\n### Build process as per `.github\\workflows\\main.yml`\n\nAssumes VS2026 build environment\n\n* dotnet tool restore\n* dotnet run --project .\\Build\\Setup.fsproj\n* dotnet run --project .\\Build\\Build.fsproj\n\n### Direction\nThe F# focus will include making rule variants that are more F# aware, to separate out the compiler generated clutter from the code the developer can affect -- avoiding smothering the code in `[\u003cSuppressMessage\u003e]`, or throwing rules out for poor signal to noise.  But there will inevitably be some more originals.\n\n### Badges\n[![Nuget](https://buildstats.info/nuget/altcode.dixon?includePreReleases=true)](https://www.nuget.org/packages/altcode.dixon)\n\n| | | |\n| --- | --- | --- | \n| **Build** |\u003csup\u003eGitHub\u003c/sup\u003e [![CI](https://github.com/SteveGilham/altcode.dixon/workflows/CI/badge.svg)](https://github.com/SteveGilham/altcode.dixon/actions?query=workflow%3ACI) | [![Build history](https://buildstats.info/github/chart/SteveGilham/altcode.dixon?branch=master)](https://buildstats.info/github/chart/SteveGilham/altcode.dixon?branch=master)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevegilham%2Faltcode.dixon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevegilham%2Faltcode.dixon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevegilham%2Faltcode.dixon/lists"}