Aspire AppHost SDK not found (MSB4236)¶
For a Forge 3.x AppHost that cannot resolve Aspire.AppHost.Sdk, check that the project references the supported SDK version, then restore and build it. Use the version supported by your Forge release rather than copying the example version without checking.
🚨 Symptom¶
Building or starting the AppHost project fails immediately:
Appears in dotnet build/dotnet run output and when starting local orchestration.
📌 Applies to¶
This article covers Forge 3.x Aspire AppHost projects. Check the version compatibility matrix for the supported Aspire version; the 13.1.0 example below is not a recommendation to upgrade or downgrade a different Forge release.
- Open the affected AppHost
.csprojand run the restore/build commands from its project directory. - Confirm that the required .NET SDK is available and that you can access the project's configured NuGet feeds. Restore needs those feeds to obtain dependencies.
- Preserve unrelated project settings when correcting the SDK reference. Do not replace the entire project file with the one-line example.
✅ Fix¶
-
Ensure the AppHost
.csprojpins the SDK with the version supported by your Forge version: -
Restore from the AppHost project directory:
🔬 Verify¶
From the same AppHost project directory, run:
The build completes without MSB4236.
If the SDK still cannot resolve, inspect the restore output and check the configured NuGet feed and network access before changing the version again. Microsoft's MSB4236 guidance covers these resolver failures and other SDK-resolution causes.
🧠 Cause¶
The AppHost project declares Aspire.AppHost.Sdk as an MSBuild project SDK. A missing version in the Sdk attribute, an unsupported version, or an SDK package that cannot restore prevents MSBuild from resolving it before compilation. Check the version declaration and restore result rather than treating the error as an application-code failure.
📚 Related¶
- Version compatibility matrix: package version mismatches
- dotnet restore reference