Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a project by path does not work in Visual Studio #1486

Closed
bastiennoel93 opened this issue Dec 22, 2023 · 14 comments
Closed

Adding a project by path does not work in Visual Studio #1486

bastiennoel93 opened this issue Dec 22, 2023 · 14 comments
Assignees
Labels
area-tooling bug Something isn't working

Comments

@bastiennoel93
Copy link

Hi,
An error occurs when I run aspire in multi repositories.

Here is my test case:
image

The error loops indefinitely in the console.
I receive a 500 error with no details.
image

On the dashboard, I see that the project is starting up:
image

Have you ever had this problem?

Thanks.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Dec 22, 2023
@davidfowl davidfowl added area-orchestrator bug Something isn't working and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners untriaged labels Dec 22, 2023
@davidfowl
Copy link
Member

What do the logs say for the dapr side car in the dashboard?

@bastiennoel93
Copy link
Author

The dapr side logs indicate that it does not find the remote application.

The problem does not come from dapr because when I do without the problem persists.

@rem-coding
Copy link

rem-coding commented Dec 27, 2023

@bastiennoel93 - when using the new AddProject() syntax from Preview 2, I seem to be hitting very similar when running from Visual Studio, but it works fine from the dotnet run command line. Are you seeing the same with your testing?

@davidfowl - is there something different between VS and dotnet command line environments that will help reproduce?

@bastiennoel93
Copy link
Author

@rem-coding Yes, when i use the dotnet run command line, it works fine. 👍
The problem comes from execution with visual studio.

@davidfowl
Copy link
Member

Can you provide a sample that reproduces the problem?

@rem-coding
Copy link

rem-coding commented Dec 31, 2023

Hi @davidfowl , it can be reproduced with the aspire-starter template as follows:

  1. dotnet new aspire-starter --project AspireStarter
  2. Replace AddProject<>() with AddProject() using the new reference path feature.
  3. Remove the AspireStarter.ApiService csproj from the Visual Studio Solution.

Fails to run from Visual Studio, works fine running from command line dotnet run.

The 2 changes to the Solution in below screenshot:
image

Error when run from Visual Studio:
image

Runs correctly from command line:
image

@dbreshears
Copy link
Contributor

@BillHiebert. Looks like this is something on the VS side since it works on the command line.

@DamianEdwards
Copy link
Member

@vijayrkn looks like this is an issue in the VS support for Aspire.

@jonathanpickard3sq
Copy link

jonathanpickard3sq commented Jan 11, 2024

Hi - just to let you know that in the meantime, if I do a dotnet run in the AppHost project directory then I can get the AppHost running without errors and can see all microservices spinning up successfully. I've been able to get one API (a backend for frontend API) to call another microservice and let Aspire take care of service discovery. I've also been able to manually attach a debugger using Visual Studio 2022 Preview and hit breakpoints. The only thing that doesn't work is launch/debug directly in Visual Studio using AppHost as the startup project. If that could be fixed then that would be great (perhaps current working directory has something to do with the issue?).

@DamianEdwards
Copy link
Member

@jonathanpickard3sq thanks for the update. We've identified the root cause in the VS support for launching Aspire AppHost projects and are investigating.

@tlmii
Copy link
Member

tlmii commented Jan 16, 2024

We're looking into what our options would be here. In the meantime, another workaround that you could potentially use here is to create another VS solution that includes all of the projects you're interested in using together with Aspire. The overload with the path to the project should work fine as long as the project is loaded in VS.

@davidfowl
Copy link
Member

@vijayrkn @BillHiebert This one is pretty important to find a solution for.

@davidfowl davidfowl changed the title Run session could not be started Adding a project by path does not work in Visual Studio Feb 25, 2024
@joperezr
Copy link
Member

from @vijayrkn this is now done.

@davidfowl
Copy link
Member

TBH this isn't fully fixed, you can track #2154 for a follow up. There's work remaining in the app host #2154 (comment).

@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-tooling bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants