Cadenza.SdkResolver 1.0.15

dotnet add package Cadenza.SdkResolver --version 1.0.15
                    
NuGet\Install-Package Cadenza.SdkResolver -Version 1.0.15
                    
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="Cadenza.SdkResolver" Version="1.0.15" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cadenza.SdkResolver" Version="1.0.15" />
                    
Directory.Packages.props
<PackageReference Include="Cadenza.SdkResolver" />
                    
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 Cadenza.SdkResolver --version 1.0.15
                    
#r "nuget: Cadenza.SdkResolver, 1.0.15"
                    
#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 Cadenza.SdkResolver@1.0.15
                    
#: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=Cadenza.SdkResolver&version=1.0.15
                    
Install as a Cake Addin
#tool nuget:?package=Cadenza.SdkResolver&version=1.0.15
                    
Install as a Cake Tool

Cadenza.SdkResolver

Read this in 한국어.

Optional, opt-in MSBuild SDK resolver for the Cadenza single-file scripting SDK family. Installing it lets dotnet run app.cs and dotnet build accept:

#:sdk Cadenza               // no version — resolved to the latest stable on nuget.org
#:sdk Cadenza@latest        // explicit "latest" alias
#:sdk Cadenza@*             // wildcard alias

The canonical Cadenza workflow does NOT require this package — dotnet run app.cs with an exact pinned version (#:sdk Cadenza@1.0.15) already works without any extra install. Install this resolver only if you specifically want the version-less / @latest shorthand in scripts where reproducibility is not critical (quick experiments, REPL-style throwaway code).

For production scripts you want to pin an exact version anyway. See the project repository for the broader story.

How it fits into MSBuild

MSBuild walks a chain of SDK resolvers in priority order. The bundled NuGet resolver activates only when a version is specified. This resolver runs at priority 4500 (before NuGet at 5500), recognizes any Cadenza* SDK reference with an empty / latest / * version, queries https://api.nuget.org/v3-flatcontainer/<id>/index.json for the highest stable SemVer, downloads the matching nupkg into ~/.nuget/packages/, and returns the path to its Sdk/ directory. Concrete versions (e.g. Cadenza@1.0.15) are deferred to the NuGet resolver via a null return.

Install

There is intentionally no automated installer — the resolver requires writing the assembly to a specific location and setting one environment variable. Use whichever path fits your workflow:

macOS / Linux

PKG=$(curl -fsSL https://api.nuget.org/v3-flatcontainer/cadenza.sdkresolver/index.json | \
      grep -oE '"[^"]+"' | grep -vE '\-' | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -1)
TMP=$(mktemp -d)
curl -fsSL "https://api.nuget.org/v3-flatcontainer/cadenza.sdkresolver/$PKG/cadenza.sdkresolver.$PKG.nupkg" -o "$TMP/pkg.nupkg"
unzip -q "$TMP/pkg.nupkg" 'tools/net10.0/*' -d "$TMP/x"
DEST="$HOME/.cadenza/sdk-resolvers/Cadenza.SdkResolver"
mkdir -p "$DEST"
cp "$TMP/x/tools/net10.0/Cadenza.SdkResolver.dll" "$DEST/"
cp "$TMP/x/tools/net10.0/Cadenza.SdkResolver.xml" "$DEST/"
rm -rf "$TMP"
echo 'export MSBUILDADDITIONALSDKRESOLVERSFOLDER="$HOME/.cadenza/sdk-resolvers"' >> ~/.bashrc  # or ~/.zshrc, ~/.profile

Then open a fresh terminal.

Windows (PowerShell)

$idx = Invoke-RestMethod 'https://api.nuget.org/v3-flatcontainer/cadenza.sdkresolver/index.json'
$ver = $idx.versions | Where-Object { $_ -notmatch '-' } | Sort-Object {[Version]$_} | Select-Object -Last 1
$tmp = New-Item -ItemType Directory -Force "$env:Temp\cadenza-resolver-$([guid]::NewGuid().ToString('N'))"
Invoke-WebRequest "https://api.nuget.org/v3-flatcontainer/cadenza.sdkresolver/$ver/cadenza.sdkresolver.$ver.nupkg" -OutFile "$tmp\pkg.nupkg"
Expand-Archive "$tmp\pkg.nupkg" -DestinationPath "$tmp\x" -Force
$dest = "$env:UserProfile\.cadenza\sdk-resolvers\Cadenza.SdkResolver"
New-Item -ItemType Directory -Force $dest | Out-Null
Copy-Item "$tmp\x\tools\net10.0\Cadenza.SdkResolver.dll" $dest -Force
Copy-Item "$tmp\x\tools\net10.0\Cadenza.SdkResolver.xml" $dest -Force
Remove-Item $tmp -Recurse -Force
[Environment]::SetEnvironmentVariable('MSBUILDADDITIONALSDKRESOLVERSFOLDER', "$env:UserProfile\.cadenza\sdk-resolvers", 'User')

Then open a fresh terminal.

Uninstall

Remove the resolver folder and clear the env var:

# POSIX
rm -rf ~/.cadenza/sdk-resolvers
# then delete the export line from your shell profile
# Windows
Remove-Item "$env:UserProfile\.cadenza\sdk-resolvers" -Recurse -Force
[Environment]::SetEnvironmentVariable('MSBUILDADDITIONALSDKRESOLVERSFOLDER', $null, 'User')

Trade-offs you are opting into

  • Non-determinism. Cadenza@latest resolves to a different version over time. Two dotnet run invocations weeks apart may compile against different SDKs. Pin an exact version for any script you intend to publish or share.
  • Network at evaluation time. The resolver queries nuget.org once per invocation (uncached). Offline / restricted-network environments will fall through to the bundled NuGet resolver, which then fails with the standard "no version specified" error.
  • Public feed only. The resolver hits nuget.org directly; it doesn't honor private feeds or nuget.config-configured sources for the version lookup step (it does use the user's global packages folder for caching the extracted SDK).

See the main repository for the broader Cadenza family.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • net10.0

    • 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.15 221 5/28/2026
1.0.14 118 5/26/2026
1.0.13 119 5/26/2026
1.0.12 119 5/26/2026