Build SDK
Purview .NET Project SDK Wiki
Section titled “Purview .NET Project SDK Wiki”This wiki is the project documentation hub for Purview.BuildSdk — a reusable MSBuild SDK NuGet package that delivers standardised .NET project defaults, code-style enforcement, test-framework wiring, and Central Package Management integration. Install it once per repo; every project beneath the repo root inherits everything automatically.
Start here
Section titled “Start here”- Getting Started
- Project Naming Conventions
- Project Type Detection
- Configuration Reference
- Version Detection
- Assembly Name Generation
- InternalsVisibleTo
- Testing Wiring
- Packaging
- SDK-Shipped Analyzers
- Code Fixes
- Repository Bootstrap
- Agent Folder
- Release Flow
Feature highlights
Section titled “Feature highlights”- Project type detection —
IsCSharpProject,IsTestProject,IsSharedTestingProject,IsContainerProject,IsWebSdkProject,IsAspireHostProject,IsCLIProject, … driven by the.csprojfilename, theSdkattribute, and on-disk markers. - C# defaults —
net10.0TFM (overridable,netstandard2.0for Roslyn components),LangVersion=preview(latestfor Roslyn components),Nullable=enable,ImplicitUsings=enable, deterministic builds,ManagePackageVersionsCentrally=true. - Code style — an
.editorconfigbaked into the package, applied viaEditorConfigFilePath, and auto-bootstrapped to the repo root if missing;EnforceCodeStyleInBuild=true,EnableNETAnalyzers=true,AnalysisLevel=latest,AnalysisMode=All. - Assembly identity —
RootNamespaceis the canonical public name;AssemblyNameandPackageIddefault to the fully evaluatedRootNamespace(or the full logical project name when suffix stripping removed a segment). - Testing framework —
TestingFramework: TUnit (default),Xunit, orNone;SubstituteFramework: TUnitMocks (default),NSubstitute, orNone;TestDataFramework: Bogus (default) orNone. - Version detection — the
versionfield from the repopackage.jsonis applied toVersionandPackageVersionautomatically, with local caching and a strict mode. - Repository bootstrap — missing repo-root
.editorconfigandglobal.jsonare auto-copied or created by default (DisableAutoCopySdkFiles=trueto opt out). - Bundled analyzers and code fixes —
PDS0001–PDS0005plus IDE code fixes for naming and extensions-namespace conventions. - Agent folder — the package ships
.agents/**content that is copied into the consuming repository so coding agents can discover repository-aware guidance automatically.
Requirements
Section titled “Requirements”- .NET SDK 10.0 or later (the default TFM for source projects is
net10.0). - A
NamespacePrefixset before the SDK import. - A
Directory.Packages.propsat the repo root when Central Package Management is used (the SDK setsManagePackageVersionsCentrally=true).
Repository layout
Section titled “Repository layout”src/src/BuildSdk— the packable MSBuild SDK package (Purview.BuildSdk), with the SDK logic underSdk/.src/src/Analyzers— Roslyn analyzer/suppressor assembly (Purview.BuildSdk.Analyzers).src/src/CodeFixers— Roslyn code-fix assembly (Purview.BuildSdk.CodeFixers).src/tests— unit, integration, and SDK harness test projects.docs/wiki— this wiki.templates/— ready-to-copy starter files for consuming repositories.