ISOCodex.Currency.Analyzers 1.1.1

dotnet add package ISOCodex.Currency.Analyzers --version 1.1.1
                    
NuGet\Install-Package ISOCodex.Currency.Analyzers -Version 1.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ISOCodex.Currency.Analyzers" Version="1.1.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ISOCodex.Currency.Analyzers" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="ISOCodex.Currency.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ISOCodex.Currency.Analyzers --version 1.1.1
                    
#r "nuget: ISOCodex.Currency.Analyzers, 1.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ISOCodex.Currency.Analyzers@1.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ISOCodex.Currency.Analyzers&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=ISOCodex.Currency.Analyzers&version=1.1.1
                    
Install as a Cake Tool

ISOCodex.Currency.Analyzers

Public documentation and support

Roslyn analyzers for ISOCodex.Currency.

The compiler host must provide Microsoft.CodeAnalysis 5.3 or later. The application may target .NET Framework 4.7.2+, provided it uses a supported compiler host; the analyzer's netstandard2.0 target does not promise support for older Roslyn hosts. The compatibility gate checks package loading and diagnostics for net472, net48 and net10.0 consumers. Use a serviced SDK (10.0.303 or later) for release builds.

Install

<PackageReference Include="ISOCodex.Currency.Analyzers" Version="1.1.1" PrivateAssets="all" />

Diagnostics

ISOCCUR001

Avoid default(Money). Use Money.Zero(currency) or Money.Of(amount, currency).

Money value = default(Money); // ISOCCUR001
Money other = default;        // ISOCCUR001 when converted to Money

ISOCCUR002

Avoid default(CurrencyCode). Use CurrencyCode.Parse(...), CurrencyCode.TryParse(...), or a known static code such as CurrencyCode.GBP.

CurrencyCode value = default(CurrencyCode); // ISOCCUR002
CurrencyCode other = default;               // ISOCCUR002 when converted to CurrencyCode

ISOCCUR003

Do not ignore MoneyValidationResult or MoneyParseResult. Store the result and check Succeeded plus the stable failure reason before continuing.

Money.TryCreate(12.345m, CurrencyCode.GBP);        // ISOCCUR003
new MoneyParser().Parse("GBP 12.345");             // ISOCCUR003

var result = Money.TryCreate(12.345m, CurrencyCode.GBP);
if (!result.Succeeded)
{
    Console.WriteLine(result.FailureReason);
}

ISOCCUR005

Do not enable symbol parsing without an expected currency. Currency symbols are ambiguous across cultures and territories, so symbol parsing should be anchored to the currency the caller already expects.

new MoneyParseOptions(
    new CultureInfo("en-GB"),
    currencyStyles: MoneyParseCurrencyStyles.CodeOrSymbol); // ISOCCUR005

new MoneyParseOptions(
    new CultureInfo("en-GB"),
    CurrencyCode.GBP,
    MoneyParseCurrencyStyles.CodeOrSymbol);                 // ok

This analyzer package does not include code fixes.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.1.1 89 9/19/2026
1.1.0 87 9/19/2026
1.0.2 138 6/23/2026
1.0.1 120 6/23/2026
1.0.0 120 6/23/2026
0.9.0-alpha.15 70 6/23/2026
0.9.0-alpha.14 75 6/23/2026
0.9.0-alpha.13 72 6/23/2026
0.9.0-alpha.12 73 6/23/2026
0.9.0-alpha.11 70 6/23/2026
0.9.0-alpha.10 73 6/23/2026
0.9.0-alpha.9 71 6/22/2026
0.9.0-alpha.8 70 6/22/2026
0.9.0-alpha.7 98 6/22/2026
0.9.0-alpha.6 72 6/22/2026
0.9.0-alpha.5 69 6/22/2026
0.9.0-alpha.4 64 6/22/2026
0.9.0-alpha.2 75 6/22/2026
0.9.0-alpha.1 78 6/22/2026
0.1.0-alpha.8 73 6/22/2026
Loading failed

Updated NuGet project and README links to public documentation and aligned ISOCodex patch dependencies. Existing APIs, targets and MIT licensing are unchanged.