Skip to content

ANcpLua/ANcpLua.NET.Sdk

Repository files navigation

NuGet .NET 10 License

ANcpLua.NET.Sdk

Opinionated MSBuild SDK for .NET projects.

Quick Start

global.json:

{
  "msbuild-sdks": {
    "ANcpLua.NET.Sdk": "3.4.31",
    "ANcpLua.NET.Sdk.Web": "3.4.31",
    "ANcpLua.NET.Sdk.Test": "3.4.31"
  }
}
<!-- Library/Console/Worker -->
<Project Sdk="ANcpLua.NET.Sdk"></Project>

<!-- Web API -->
<Project Sdk="ANcpLua.NET.Sdk.Web"></Project>

<!-- Test -->
<Project Sdk="ANcpLua.NET.Sdk.Test"></Project>

Central Package Management is mandatory

All variants force <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> (and the enforcement target errors if a consumer overrides it). Every consuming repo must ship a Directory.Packages.props at or above the consumer's directory — even an empty one suffices:

<!-- Directory.Packages.props -->
<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>
</Project>

Without it, restore fails with NU1015: PackageReference items do not have a version specified on the SDK-injected analyzers (ANcpLua.Analyzers, Microsoft.CodeAnalysis.BannedApiAnalyzers) because the SDK switches them to GlobalPackageReference, which only resolves through CPM.

Documentation

ancplua.mintlify.app

Related


Initial architecture inspired by Meziantou.NET.Sdk.

About

MSBuild SDK for .NET projects. Auto-injects analyzers, enables nullable, sets LangVersion, adds polyfills. Variants: Library, Web (ASP.NET Core), Test (xUnit v3 MTP).

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors