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
<PackageReference Include="Alvecta.Analyzers.PublicPropertySetters" Version="1.1.24"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Alvecta.Analyzers.PublicPropertySetters" Version="1.1.24" />
<PackageReference Include="Alvecta.Analyzers.PublicPropertySetters"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Alvecta.Analyzers.PublicPropertySetters --version 1.1.24
#r "nuget: Alvecta.Analyzers.PublicPropertySetters, 1.1.24"
#:package Alvecta.Analyzers.PublicPropertySetters@1.1.24
#addin nuget:?package=Alvecta.Analyzers.PublicPropertySetters&version=1.1.24
#tool nuget:?package=Alvecta.Analyzers.PublicPropertySetters&version=1.1.24
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
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 |