Skip to content

Unable to debug Aspire Resource project while testing #5257

Open
@galvesribeiro

Description

@galvesribeiro

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When following the docs to create test projects which spin up Aspire services for integration tests, it is not possible to hit a breakpoint and debug the services just like we would when running the Aspire project outside the tests.

Breakpoints on the test code and the AppHost itself are hit just fine. Only the projects orchestrated by the AppHost which are not.

Expected Behavior

To be able to set breakpoints on the downstream Aspire projects and they would be hit while debugging tests, just as in the normal runtime of Aspire apps.

Steps To Reproduce

  1. Follow the docs and add a test project to an existing Aspire solution: https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/testing?pivots=xunit
  2. Put a break point in any place on the downstream projects. It can be on Program.cs or any code that would be otherwise triggered as part of the tests;
  3. Debug the test;
  4. Observe that the breakpoint is never hit;

I've tested and reproduced on VSCode and Rider. I have no Windows box to test on Visual Studio tho.

Exceptions (if any)

No response

.NET Version info

.NET SDK:
 Version:           8.0.302
 Commit:            ef14e02af8
 Workload version:  8.0.300-manifests.e4379c3d
 MSBuild version:   17.10.4+10fbfbf2e

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  14.5
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.302/

.NET workloads installed:
 [aspire]
   Installation Source: SDK 8.0.300
   Manifest Version:    8.1.0/8.0.100
   Manifest Path:       /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.aspire/8.1.0/WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      8.0.6
  Architecture: arm64
  Commit:       3b8b000a0e

.NET SDKs installed:
  6.0.417 [/usr/local/share/dotnet/sdk]
  7.0.404 [/usr/local/share/dotnet/sdk]
  8.0.100 [/usr/local/share/dotnet/sdk]
  8.0.101 [/usr/local/share/dotnet/sdk]
  8.0.201 [/usr/local/share/dotnet/sdk]
  8.0.302 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.25 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.25 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Anything else?

Aspire and ASP.Net on its latest versions.

Rider and VSCode also on its latest stable versions.

Metadata

Metadata

Labels

area-toolingvs-codeIssues related to vs code tooling for aspire

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions