Webority.Analyzers 0.39.2

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

Webority.Analyzers

The Webority fleet's banned-API rules at build time: one list of banned types, members and namespaces, each with the rule it breaks, enforced by the banned API analyzer (RS0030) in every project of a repo that references this package, plus a file-precise, shrink-only baseline for hits a repo already has.

Adopt

This package arrives through the Webority.Build SDK, which references it in every project. A repo adds an msbuild-sdks entry for Webority.Build to global.json, imports Sdk.props as the first line of Directory.Build.props and Sdk.targets as the last line of Directory.Build.targets, both with Sdk="Webority.Build". The repository README describes the migration from a direct reference.

Baseline

.webority/baselines/rule-baseline.txt at the repo root (the folder holding .webority/settings.json), one line per file and symbol:

<repo-relative path>;<symbol ID>;<count>;<baseline|boundary>;<reason>

At most count hits of the symbol in the file are suppressed (WBA0005), the first in source order; every other hit still fails the build. A method is written without its parameter list and covers every overload. A line that cannot be read is reported as WBA1001.

The null-forgiving operator has its own baseline line: WBA5003 in place of a symbol ID, with baseline as its kind only. Its count is exact: it must equal the number of x!, null! and default! uses in that file. A count above the hits fails the build (WBA5003), and a boundary line with WBA5003 is refused (WBA1001). WBA5004 takes no baseline line.

Rules

  • WBA5003 (error): a null-forgiving operator in hand-written code or a Razor view or component beyond the file's baseline count, or a baseline count above the file's hits.
  • WBA5004 (error): a switch-off of a nullable check: a NoWarn, WarningsNotAsErrors or TreatWarningsAsErrors setting that lowers a nullable warning, an editorconfig severity below error for one, a #pragma warning disable that names one or the nullable group, and a SuppressMessage naming one. WBA5001 to WBA5004 are nullable rules too. A lowered WBA5004 is reported under WBA5003.
  • WBA6006 (warning): an aggregate root maps no row version, so two saves of the same record overwrite each other; map builder.Property<byte[]>("RowVersion").IsRowVersion() on it or [Timestamp] on the root.
  • WBA6007 (warning): a DbContext maps entities and marks none of them [AggregateRoot], so WBA6006 checks nothing; put [AggregateRoot] on each entity the API loads and saves as a whole.
  • WBA9002 (warning): an id is declared as a plain number.
  • WBA9003 (warning): a switch over an enum does not name every member, or its catch-all does not throw; name each member in its own case or arm, and make a catch-all arm throw.
  • WBA2003 (warning): a money amount is declared as a plain number.
  • WBA8009 (warning): a wire type carries an internal id.
  • WBA8010 (warning): a product declares its own copy of a library type; delete it and use the package type the message names.
  • WBA8011 (warning): an API head keeps a type in a DataObject or DTOs folder; move it to DataObjects/Request, DataObjects/Response or DataObjects/Mapper.
  • WBA8015 (warning): an entity has no constructor EF Core can bind; rename the parameter after its property, or add a private parameterless constructor.
  • WBA8016 (warning): a date or time property does not state its kind and zone in its name; rename it with its column and wire field.
  • WBA8017 (warning): an endpoint states no access rule; put [Authorize] on the narrowest covering place, or [AllowAnonymous] on an action that is public on purpose.
  • WBA8018 (error): a typed attribute of a Webority.Ui.Razor tag helper has a value its enum does not have; the message lists the allowed values. It fires only beside the compiler's CS0117.
  • WBA8019 (warning): an entity type configuration is never applied, because nothing creates, names or scans it in a project with its own DbContext; apply it in OnModelCreating or delete it.
  • WBA8021 (warning): a tag helper reads HttpContext.Request inside Process or ProcessAsync; move the read into a private method that returns only the value it needs.
  • WBA8022 (error): Failure.Of or new BusinessRuleValidationException is called with FailureCodes.ValidationFailed, which throws when it runs; build the failure with Failure.Validation(field, message).
  • WBA4005 (warning): parallel work over a collection has no cap (Task.WhenAll over a Select, or Parallel.ForEachAsync without MaxDegreeOfParallelism).
  • WBA6008 (warning): a method saves twice with no transaction open, so a failed second save leaves the first committed; run the saves in one transaction inside the execution strategy.
  • WBA6009 (warning): a query includes two collection navigations with no split choice.
  • WBA6010 (warning): a database call runs once per loop item; load the set once before the loop instead.
  • WBA6011 (warning): a filter, sort or page runs in memory on a list already loaded from the database; move it into the query before the list read.
  • WBA6012 (warning): a web project reads a list with no row limit.
  • WBA6013 (warning): a read-only request loads tracked entities; add AsNoTracking() or project with Select.
  • WBA6014 (warning): a Skip or Take on a query with no OrderBy before it.
  • WBA7006 (warning): a concrete controller states no security realm, or two; mark its base with [SecurityRealm], or the controller with [NoSecurityRealm("why")].
  • WBA7007 (warning): a public action of an operator controller states no permission; add [HasPermission] or [NoPermissionRequired("why")].
  • WBA7008 (warning): a value printed as raw HTML (Html.Raw or new HtmlString) that is not a constant, a sanitised value or serialised JSON.
  • WBA7009 (warning): an upload handler with no size ceiling; add [RequestSizeLimit] or [RequestFormLimits] matched to the largest real file.
  • WBA7010 (warning): an [Idempotent] endpoint whose request size limit is above what it buffers, or whose MaxBodyBytes is outside 1,024 bytes to 512 MB, which stops the host at start-up; set [Idempotent(MaxBodyBytes = N)] to cover the limit.
  • WBA7011 (error): [Idempotent], [RequestSizeLimit], [DisableRequestSizeLimit] or [RequestFormLimits] on a Razor Pages handler method, where Razor Pages never applies it; put it on the PageModel class, or move the handler to a controller.
  • WBA8023 (warning): a Razor template that injects a DbContext; load the data in the page model instead.
  • Fix a switch-off by turning TreatWarningsAsErrors on and removing the lowering, then fixing the code it hides.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.51.0 68 11/26/2026
0.50.1 63 11/25/2026
0.50.0 61 11/25/2026
0.49.0 58 11/25/2026
0.48.2 59 11/25/2026
0.48.1 51 11/25/2026
0.48.0 65 11/24/2026
0.47.4 102 11/24/2026
0.47.3 80 11/24/2026
0.47.2 80 11/24/2026
0.47.1 97 11/23/2026
0.47.0 89 11/23/2026
0.46.0 90 11/23/2026
0.45.4 102 11/22/2026
0.45.3 96 11/22/2026
0.45.2 97 11/22/2026
0.45.1 98 11/22/2026
0.45.0 102 11/22/2026
0.44.0 99 11/22/2026
0.39.2 97 11/19/2026
Loading failed