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         ...

Cache stampede: when our cache turned against us

While investigating some performance issues, we ran into an ASP.NET Core API that cached a fairly expensive aggregation query for 60 seconds. Under normal load, that was fine: one request rebuilds the cache, everyone else reads from it. Under peak load, dozens of requests would arrive in that same expiry window, all see a cache miss, and all fire the same expensive query in parallel. The database didn't like that. That was the moment when our caching layer stopped helping and started hurting. A burst of requests comes in at the same time, all miss the cache, and all go hammer the database or the downstream API at once. That's a cache stampede . The cache was supposed to protect our backend, and for a few hundred milliseconds it did the opposite. Why this happens IMemoryCache.GetOrCreate (and its async sibling) looks like it protects you, but it doesn't add any locking on its own. Look at the naive version: public async Task<Report> GetReportAsync(string key) ...

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.