Posseth.NamedArguments.AnalyzerAndFixer 1.0.1.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Posseth.NamedArguments.AnalyzerAndFixer --version 1.0.1.3
                    
NuGet\Install-Package Posseth.NamedArguments.AnalyzerAndFixer -Version 1.0.1.3
                    
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="Posseth.NamedArguments.AnalyzerAndFixer" Version="1.0.1.3">
  <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="Posseth.NamedArguments.AnalyzerAndFixer" Version="1.0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="Posseth.NamedArguments.AnalyzerAndFixer">
  <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 Posseth.NamedArguments.AnalyzerAndFixer --version 1.0.1.3
                    
#r "nuget: Posseth.NamedArguments.AnalyzerAndFixer, 1.0.1.3"
                    
#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 Posseth.NamedArguments.AnalyzerAndFixer@1.0.1.3
                    
#: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=Posseth.NamedArguments.AnalyzerAndFixer&version=1.0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=Posseth.NamedArguments.AnalyzerAndFixer&version=1.0.1.3
                    
Install as a Cake Tool

Posseth NamedArguments AnalyzerAndFixer

This is a tool that can be used to analyze and fix named arguments in codebase. It is implemented as a Analyzer and CodeFix provider for Roslyn.

Installation

There should be a NuGet package available for this project.

configuration

<b>How to Configure Settings for NamedArgumentsAnalyzer</b>

OnlyForRecords is a boolean and standard value is false. setting that determines whether the analyzer should only apply to record types. If set to true, the analyzer will only analyze named arguments in record types. If set to false, it will analyze named arguments in all types.

UseDefaultExcludedMethods is a boolean and standard value is true. if UseDefaultExcludedMethods is true, the following methods will be excluded by default: "System.Char.Equals", "System.Char.CompareTo", "System.Char.GetUnicodeCategory", "System.Char.IsControl", "System.Char.IsDigit", "System.Char.IsLetter", "System.Char.IsLetterOrDigit", "System.Char.IsLower", "System.Char.IsNumber", "System.Char.IsPunctuation", "System.Char.IsSeparator", "System.Char.IsSurrogate", "System.Char.IsSymbol", "System.Char.IsUpper", "System.Char.IsWhiteSpace", "System.Char.ToLower", "System.Char.ToLowerInvariant", "System.Char.ToUpper", "System.Char.ToUpperInvariant", "System.Char.GetNumericValue", "System.String.Contains", "System.String.EndsWith", "System.String.StartsWith", "System.String.Equals", "System.String.IndexOf", "System.String.LastIndexOf", "System.String.Replace", "System.String.Split", "System.String.Trim", "System.String.TrimStart", "System.String.TrimEnd", "System.String.Insert", "System.String.Remove", "System.String.Substring", "System.String.IsNullOrEmpty", "System.String.IsNullOrWhiteSpace", "System.Text.StringBuilder.Append", "System.Text.StringBuilder.AppendLine", "System.Text.StringBuilder.Insert", "System.Text.StringBuilder.Replace", "System.Text.StringBuilder.Remove", "System.Globalization.CharUnicodeInfo.GetUnicodeCategory", "System.Globalization.CharUnicodeInfo.GetDigitValue", "System.Globalization.CharUnicodeInfo.GetNumericValue", "System.Linq.Enumerable.Where", "System.Linq.Enumerable.Select", "System.Linq.Enumerable.FirstOrDefault", "System.Linq.Enumerable.First", "System.Linq.Enumerable.Any", "System.Linq.Enumerable.OrderBy", "System.Linq.Enumerable.OrderByDescending", "System.Linq.Enumerable.GroupBy", "System.Linq.Enumerable.ToList", "System.Linq.Enumerable.ToArray", "System.Linq.Enumerable.Contains", "System.Linq.Enumerable.ElementAt", "System.Linq.Enumerable.ElementAtOrDefault", "System.Linq.Enumerable.All", "System.Linq.Enumerable.Count", "System.Linq.Enumerable.Last", "System.Linq.Enumerable.LastOrDefault"

ExcludedMethodNames is a comma-separated list of method names you want to exclude from the analyzer. default value is "" thus empty.

You can configure the OnlyForRecords and ExcludedMethodNames settings using an .editorconfig file. Here's how to do it:

Option 1: Using .editorconfig File

  1. Create or open an .editorconfig file in the root of your solution or project.
  2. Add the following configuration entries:
# Named Arguments Analyzer Configuration
[*.{cs,vb}]

# Configure OnlyForRecords option
dotnet_diagnostic.PNA1000.OnlyForRecords = true  # or false
dotnet_diagnostic.PNA1000.UseDefaultExcludedMethods = true  # or false

# Configure ExcludedMethodNames option
dotnet_diagnostic.PNA1000.ExcludedMethodNames = ToString,Equals,GetHashCode

Option 2: Configure in Visual Studio

  1. Right-click on your solution in Solution Explorer
  2. Select Analyze > Configure Code Analysis > For Solution
  3. In the dialog that appears, find your analyzer (PNA1000)
  4. Configure the settings for OnlyForRecords and ExcludedMethodNames

Option 3: Configure in Project File (.csproj) You can also add these settings to your project file:

<PropertyGroup>
  <AnalysisMode>All</AnalysisMode>
</PropertyGroup>
<ItemGroup>
  <EditorConfigFiles Include=".editorconfig" />
</ItemGroup>
<PropertyGroup>
  <AnalyzerConfigFiles Include="$(MSBuildProjectDirectory)\.analyzer.config" />
</PropertyGroup>

Then create a .analyzer.config file with:

is_global = true
PNA1000.OnlyForRecords = true
PNA1000.UseDefaultExcludedMethods = true
PNA1000.ExcludedMethodNames = ToString,Equals,GetHashCode

The most common and recommended approach is Option 1 with the .editorconfig file, as it's the standard way to configure analyzer settings in modern .NET projects.

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.0.1.9 127 3/15/2026
1.0.1.8 212 11/15/2025
1.0.1.7 188 11/8/2025
1.0.1.6 170 11/8/2025
1.0.1.5 176 11/8/2025
1.0.1.4 175 9/28/2025
1.0.1.3 151 6/7/2025
1.0.1.2 150 6/6/2025
1.0.1.1 179 5/17/2025
1.0.0.1 263 4/15/2025
1.0.0 490 9/3/2024

release with new settings and customizations