ThePensionsRegulator.Analyzers.Umbraco 1.0.0

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

ThePensionsRegulator.Analyzers.Umbraco

Roslyn analyzers for Umbraco projects, published as a NuGet package.

Installation

dotnet add package ThePensionsRegulator.Analyzers.Umbraco

No extra .csproj configuration is needed — NuGet automatically wires up the analyzer because the DLL is placed in analyzers/dotnet/cs/ inside the package.

Analyzers

ID Severity Description
TPRUMB0001 Warning .Value<T>() called without IPublishedValueFallback

TPRUMB0001

Umbraco's .Value<T>() extension method has an overload that accepts IPublishedValueFallback. Always use this overload to ensure correct fallback behaviour and testability.

// ❌ Triggers TPRU0001
var x = page.Value<string>("alias");

// ✅ Correct
var x = page.Value<string>(_publishedValueFallback, "alias");

See docs/TPRUMB0001.md

Configuring Severity

Adjust the severity per-project via .editorconfig:

# Treat as an error
dotnet_diagnostic.TPRUMB0001.severity = error

# Or demote to a suggestion
dotnet_diagnostic.TPRUMB0001.severity = suggestion

Building

dotnet build
dotnet test
dotnet pack --configuration Release

License

MIT

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.0 62 5/12/2026