Skip to content

[main] VS Code (CLI?) incorrectly reports "The --apphost option specified a project that does not exist." if an apphost fails to build #19035

Description

@afscrome

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

If you try to run an app host that fails to build, VS Code incorrectly reports that the "Project file does not exist.

But looking at the logs, you can clearly see the project referenced exists.

[2026-08-05 22:53:15.679] [FAIL] [DotNetCliRunner] Failed to get items and properties from project. Exit code was: 1. See debug logs for more details. Stderr: REDACTED\AppHost\AppHost.csproj : error : Could not resolve SDK "Aspire.AppHost.Sdk". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.

Expected Behavior

The error should report that the project failed to build, not that the project doesn't exist.

Steps To Reproduce

  1. Try to run an apphost that doesn't build in VS Code.

(Not 100% sure if it's relevant or not but in my case the failure is a missing SDK)

Exceptions (if any)

[2026-08-05 22:53:14.906] [DBUG] [ProcessExecutionFactory] dotnet(32868) waiting for exit
[2026-08-05 22:53:15.679] [DBUG] [ProcessExecutionFactory] dotnet(32868) exited with code: 1
[2026-08-05 22:53:15.679] [DBUG] [ProcessExecutionFactory] dotnet(32868) output drained
[2026-08-05 22:53:15.679] [FAIL] [DotNetCliRunner] Failed to get items and properties from project. Exit code was: 1. See debug logs for more details. Stderr: REDACTED\AppHost\AppHost.csproj : error : Could not resolve SDK "Aspire.AppHost.Sdk". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.
REDACTED\AppHost\AppHost.csproj : error :   SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" returned null.
REDACTED\AppHost\AppHost.csproj : error :   Unable to find package Aspire.AppHost.Sdk. No packages exist with this id in source(s): AspireLocalHive. PackageSourceMapping is enabled, the following source(s) were not considered: Trayport.
REDACTED\AppHost\AppHost.csproj : error MSB4236: The SDK 'Aspire.AppHost.Sdk/13.5.0-pr.18906.g90007b1b' specified could not be found.
Build failed. Properties, Items, and Target results cannot be obtained. See details in stderr above.
, Stdout: 
[2026-08-05 22:53:15.681] [FAIL] [AspireCliTelemetry] The --apphost option specified a project that does not exist.
Aspire.Cli.Projects.ProjectLocatorException: Project file does not exist.
   at Aspire.Cli.Projects.ProjectLocator.<UseOrFindAppHostProjectFileAsync>d__30.MoveNext() + 0x1645
--- End of stack trace from previous location ---
   at Aspire.Cli.Commands.RunCommand.<ExecuteAsync>d__29.MoveNext() + 0x748
[2026-08-05 22:53:15.689] [DBUG] [ExtensionBackchannel] Starting backchannel connection to Aspire extension at localhost:64547
[2026-08-05 22:53:15.689] [DBUG] [ExtensionBackchannel] Connecting to Aspire Extension backchannel at localhost:64547
[2026-08-05 22:53:15.710] [DBUG] [ExtensionBackchannel] Connected to Aspire Extension backchannel at localhost:64547
[2026-08-05 22:53:15.783] [DBUG] [ExtensionBackchannel] Connected to ExtensionBackchannel at localhost:64547
[2026-08-05 22:53:15.783] [DBUG] [ExtensionBackchannel] Sent error message The --apphost option specified a project that does not exist.
[2026-08-05 22:53:15.784] [INFO] [Stderr] ❌ The --apphost option specified a project that does not exist.
[2026-08-05 22:53:15.784] [DBUG] [ExtensionBackchannel] Sent message See logs at C:\Users\alexanderc\.aspire\logs\cli_20260805T225314_f8224c4b.log

Aspire doctor output

Aspire Environment Check
========================

Aspire
  ⚠️ Aspire CLI version 13.5.0-preview.1.26405.1 (channel: daily) is out of date. Latest version is 13.5.0-preview.1.26405.3 (channel: prerelease)  
       Run 'aspire update' to update Aspire CLI.       
  ✅ Developer Control Plane (DCP) connection health checks succeeded  

AppHost
  ⚠️ Could not determine AppHost version (src\dotnet\connector\aspire\AppHost\AppHost.csproj)  

.NET SDK
  ✅ .NET 10.0.302 installed (x64)  

Container Runtime
  ⚠️ Docker: installed but not running ← active  
       Start Docker Desktop       

Environment
  ✅ Operating system: Windows 10.0.26100.0  
  ✅ HTTPS development certificate is trusted  

Development Tools
  ✅ Aspire extension for VS Code is installed  

Summary: 5 passed, 3 warnings, 0 failed
For detailed prerequisites: https://aka.ms/aspire-prerequisites

Aspire CLI Installations
========================

╭─────────────────────────────────────────────────────────────┬───────────────────────────────────────────────────────────────────┬──────────┬───────────┬─────────────╮
│ Path                                                        │ Version                                                           │ Channel  │ Route     │ PATH status │
├─────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────┼──────────┼───────────┼─────────────┤
│ C:\Users\alexanderc\.aspire\bin\aspire.exe (current)        │ 13.5.0-preview.1.26405.1+0182d1671498df3020eea7af5b006eb0bddbafc9 │ daily    │ (unknown) │ active      │
│ C:\Users\alexanderc\.aspire\dogfood\pr-18906\bin\aspire.exe │ 13.5.0-pr.18906.g90007b1b                                         │ pr-18906 │ pr        │ not on PATH │
╰─────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────┴──────────┴───────────┴─────────────╯

Anything else?

No response

Metadata

Metadata

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions