Alvecta.Analyzers.PublicPropertySetters 1.1.24

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

Alvecta.Analyzers.PublicPropertySetters

The Alvecta public-property-setter Roslyn analyzer, shipped as a standalone package so it can be referenced independently of the general-purpose Alvecta.Analyzers rules. It is a general encapsulation rule (no layer scoping) — reference it wherever you want public property setters flagged, typically solution-wide.

Rules

ID Category Description
ALV1201 Alvecta.Design Properties should not expose a public setter.

A public setter lets any caller mutate an object's state without passing through behaviour that can enforce the type's invariants. Prefer a get-only or private set property assigned through a constructor or an intent-revealing method. Not flagged: init-only setters, non-public setters, indexers, and override members (the base declaration is flagged instead).

Usage

<PackageReference Include="Alvecta.Analyzers.PublicPropertySetters" PrivateAssets="all" />

PrivateAssets="all" keeps the analyzer out of your package's dependency closure — it affects your build only, not your consumers'.

Configuration

dotnet_diagnostic.ALV1201.severity = error
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.24 0 10/7/2026
1.1.23 104 9/28/2026
1.1.22 101 9/17/2026
1.1.21 97 9/17/2026
1.1.20 94 9/15/2026
1.1.19 91 9/14/2026
1.1.18 116 9/9/2026
1.1.17 103 8/21/2026
1.0.16 115 8/18/2026
1.0.15 103 8/18/2026
1.0.14 105 8/18/2026
1.0.13 127 7/30/2026
1.0.12 116 7/17/2026
1.0.11 215 6/30/2026