DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter 1.0.6

dotnet add package DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter --version 1.0.6
                    
NuGet\Install-Package DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter -Version 1.0.6
                    
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="DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter" Version="1.0.6">
  <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="DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter" Version="1.0.6" />
                    
Directory.Packages.props
<PackageReference Include="DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter">
  <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 DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter --version 1.0.6
                    
#r "nuget: DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter, 1.0.6"
                    
#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 DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter@1.0.6
                    
#: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=DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter&version=1.0.6
                    
Install as a Cake Addin
#tool nuget:?package=DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter&version=1.0.6
                    
Install as a Cake Tool

DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter

A Roslyn analyzer and code fix that suggests splitting a C# class into partial method files — one file per method — following a configurable naming convention.

Works in Visual Studio and VS Code (via C# Dev Kit / OmniSharp).


Installation

dotnet add package DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter

Or in your .csproj:

<PackageReference Include="DC.Aspnet.RoslynAnalyzers.PartialMethodSplitter" Version="*">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

Enable via .editorconfig

The analyzer is off by default. Opt in by adding the following to your .editorconfig:

[*.cs]
suggest_partial_class_partial_method_files = true
dotnet_diagnostic.DC0001.severity = suggestion

How it works

Any class with 2 or more regular methods triggers DC0001, showing a blue squiggle on the class keyword.

Use the light-bulb / Quick Fix menu to:

  • Split all methods into separate partial files
  • Split a single method into its own file

Constructors, properties, fields, and events are never moved.


Configuration reference

All settings go in .editorconfig:

Key Default Description
suggest_partial_class_partial_method_files false Enables the DC0001 diagnostic
dotnet_diagnostic.DC0001.severity none suggestion / warning / error / none
partial_method_file_naming_pattern {className}.{methodName}.cs Output file name template

License

MIT © Mårten Andersson / Digital Creation Ab

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.6 131 4/22/2026
1.0.5 102 4/22/2026