Skip to main content

Fixing the "Newer version of Aspire.Hosting.AppHost required" error

After pulling some NuGet packages into my .NET Aspire project, I ran into this cryptic startup failure:


Aspire.Hosting.DistributedApplicationException: Newer version of the
Aspire.Hosting.AppHost package is required to run the application.
Ensure you are referencing at least version '13.2.2'.

   at Aspire.Hosting.Dcp.DcpDependencyCheck.EnsureDcpVersion(DcpInfo dcpInfo)
   at Aspire.Hosting.Dcp.DcpDependencyCheck.GetDcpInfoAsync(...)
   at Aspire.Hosting.Dcp.DcpHost.StartAsync(...)

The app host refuses to start, and the logs point you toward a version check deep inside DCP internals.

The error message tells me that a minimum version of the hosting package is required,but no matter how many times I randotnet restore or update NuGet packages through Visual Studio, the error persists. That's because there are two places that pin the Aspire version.

Why updating NuGet packages isn't enough

Aspire AppHost projects use a special SDK reference at the very top of the .csproj file — separate from the <PackageReference> items in the ItemGroup. This SDK reference controls how MSBuild loads the Aspire tooling before your packages are even considered. The DCP (Developer Control Plane) version check validates against the SDK version, not the NuGet version — so an outdated SDK reference will always fail, regardless of what your packages say.

Two things that must match: the Project Sdk="Aspire.AppHost.Sdk/x.x.x" attribute at the top of the csproj, and the PackageReference versions inside it. Both need to be bumped together.

The fix

Once you know this, the fix is easy:

  1. Update your NuGet packages as usual  via the NuGet manager in Visual Studio or dotnet add package.
  2. Open your *.AppHost.csproj file and look at the very first line; the Project element's Sdk attribute.
  3. Update the version number in Sdk="Aspire.AppHost.Sdk/..." to match the Aspire version you're targeting.

Here is an example for my project:

The first line is what I missed to update. The version in the Sdk attribute must be updated manually. It is not touched by NuGet restore or package update tooling.

Going forward

Whenever you upgrade .NET Aspire, treat it as a two-part update: bump all the Aspire.* NuGet packages and update the Aspire.AppHost.Sdk version in your csproj. Keeping these in sync will save you from a confusing startup failure every single time a new Aspire release lands.

Popular posts from this blog

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

VS Code Planning mode

After the introduction of Plan mode in Visual Studio , it now also found its way into VS Code. Planning mode, or as I like to call it 'Hannibal mode', extends GitHub Copilot's Agent Mode capabilities to handle larger, multi-step coding tasks with a structured approach. Instead of jumping straight into code generation, Planning mode creates a detailed execution plan. If you want more details, have a look at my previous post . Putting plan mode into action VS Code takes a different approach compared to Visual Studio when using plan mode. Instead of a configuration setting that you can activate but have limited control over, planning is available as a separate chat mode/agent: I like this approach better than how Visual Studio does it as you have explicit control when plan mode is activated. Instead of immediately diving into execution, the plan agent creates a plan and asks some follow up questions: You can further edit the plan by clicking on ‘Open in Editor’: ...