Webority.Build
0.39.3
<Sdk Name="Webority.Build" Version="0.39.3" />
#:sdk Webority.Build@0.39.3
Webority.Build
Webority.Build is the fleet's build SDK. It carries the fleet build settings (nullable, warnings as errors, language version and the rest), the rule severities the fleet config states, the fleet rule check that fails the build with WBB codes when a repo departs from them, and the pack guard, which fails dotnet pack when a package would carry symbols, source or a repository link. The SDK pins the Webority.Analyzers package, so a repo takes its banned API and rule analyzers from the SDK and lists no Webority.Analyzers reference of its own.
Install
Pin the SDK in global.json, to the newest published version:
{
"sdk": { "version": "11.0.100", "rollForward": "latestFeature" },
"msbuild-sdks": { "Webority.Build": "<version>" }
}
Import the SDK's props as the first line inside <Project> in Directory.Build.props:
<Import Project="Sdk.props" Sdk="Webority.Build" />
Import the SDK's targets as the last line inside <Project> in Directory.Build.targets:
<Import Project="Sdk.targets" Sdk="Webority.Build" />
The repo also needs a .webority/settings.json at its root with a kind field; a folders entry's own kind wins over the repo's for the projects under that folder. Only "library" gets the packed-dependency upper bounds; a missing kind fails the build as WBB1009.
Migrate a repo
global.json: add themsbuild-sdkspin above.Directory.Packages.props: delete theWebority.AnalyzersPackageVersion.Directory.Build.props: delete theWebority.AnalyzersPackageReference. The SDK pins and references the package.- Add the two imports:
Sdk.propsas the first line ofDirectory.Build.props, andSdk.targetsas the last line ofDirectory.Build.targets. Directory.Build.targets: delete thebuild/Webority.PackGuard.targetsimport, and delete the filebuild/Webority.PackGuard.targets. The SDK's targets carry the pack guard..editorconfig: delete each line whose key the SDK's global config sets. A lower value fails the build as WBB1003, and the same value as WBB1005. Keep the core options (indentation, line endings), any other key the SDK does not set, and adotnet_diagnosticline that raises a severity above the SDK's value.- Baselines: rename
.webority/baselines/banned-api-baseline.txtto.webority/baselines/rule-baseline.txtwithgit mv. If the repo has.webority/baselines/analyzer-baseline.json, delete it and theWarningsNotAsErrorsentries it backed. - Exceptions: for each suppression you keep, add an entry to
.webority/baselines/exceptions.jsonbefore seeding. Each entry is a JSON object with anid(EX-<n>), theruleit lowers, thepathsit covers (repo-relative paths or folder globs), areason, and theapprovedBywork item. Only a person approves a new entry, and the nullable ids (WBA5001toWBA5004) take no entry. Register each kept suppression before the seed build, becauseWBB1002fails aNoWarnorWarningsNotAsErrorsrule that no entry covers. An inline suppression also names itsEXid on its line. - Seed the baseline, as described below.
- Build, and fix each
WBBerror listed under Build errors.
Seed the baseline
Run the seed build, then the script that writes the baseline from its log:
DOTNET_CLI_UI_LANGUAGE=en dotnet build <Repo>.slnx --no-incremental -p:WeboritySeedBaseline=true -v q --nologo > build.log 2>&1
node <webority-analyzers>/scripts/baseline-from-build.mjs build.log
WeboritySeedBaseline keeps banned API hits (RS0030) as warnings for this one build, so every project compiles and lands in the log. The nullable rules stay errors. Never set TreatWarningsAsErrors off instead: that fails the build as WBA5004.
The script writes .webority/baselines/rule-baseline.txt with the exact count per file and key. Commit the file. From then on the normal build passes, and any new hit fails it. The script writes a new file only, and exits 1 when the log holds an error the baseline cannot hold.
A repo that already has a baseline records new hits with --add, after the same seed build:
node <webority-analyzers>/scripts/baseline-from-build.mjs build.log --add
No count goes down under --add. Lowering a count is the change that removes the hits. Build and run --add again until the log shows no hit the baseline can hold.
Build errors
The SDK checks the fleet build settings and rule severities before each .NET project compiles, and fails the build with one of these codes:
WBB1001: a project or props file sets a fleet build setting to another value. Remove the setting; the SDK sets it.WBB1002:NoWarnorWarningsNotAsErrorsnames a rule that no register entry covers. Fix the code, or register the rule for those paths as an exception.WBB1003: a repo.editorconfigor global config sets a fleet key to a lower value, or sets adotnet_diagnosticseverity belowwarning, with no register entry. Delete the line, or register it.WBB1009:.webority/settings.jsonhas nokindfield. Add it:"library"for a repo that publishes packages (the SDK caps its Webority dependencies below their next breaking line; a product that pins exact[x.y.z]versions is not a library), or"product","tool","mobile-app"or"website".WBB1004: the register or the baseline cannot be read, or holds an entry that matches nothing. Fix the file, or delete the entry that matches nothing.WBB1005: a repo.editorconfigor global config repeats a key the SDK sets, at the same value. Delete the line; no register entry passes it.WBB1006: a project referencesWebority.Analyzerswithout the SDK. Migrate the repo; no register entry passes it.WBA1002: a#pragma warning disableorSuppressMessagehas no register entry covering its file and no baseline count left for it. Fix the code, or add anEXentry that covers the file and name its id on the suppression's line.
A registered exception passes one of the WBB errors above. While an entry covers the project or file, the error for its rule does not fire. A path naming a Directory.Build.props or Directory.Build.targets covers every project in that file's folder and below, so a suppression set in a shared build settings file is registered once.
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 |
|---|---|---|
| 0.39.3 | 311 | 11/19/2026 |
| 0.39.2 | 200 | 11/19/2026 |
| 0.39.1 | 116 | 11/19/2026 |
| 0.39.0 | 156 | 11/19/2026 |
| 0.38.2 | 232 | 11/19/2026 |
| 0.38.1 | 139 | 11/19/2026 |
| 0.38.0 | 320 | 11/18/2026 |
| 0.37.0 | 171 | 11/18/2026 |
| 0.36.0 | 10,229 | 11/16/2026 |
| 0.35.0 | 10,478 | 11/15/2026 |
| 0.34.1 | 3,950 | 11/15/2026 |
| 0.34.0 | 96 | 11/15/2026 |
| 0.33.0 | 2,402 | 11/15/2026 |
| 0.32.0 | 4,350 | 11/15/2026 |
| 0.31.0 | 860 | 11/14/2026 |
| 0.30.4 | 288 | 11/14/2026 |
| 0.30.3 | 806 | 11/14/2026 |
| 0.30.2 | 702 | 11/14/2026 |
| 0.30.1 | 4,938 | 11/14/2026 |
| 0.30.0 | 1,023 | 11/14/2026 |