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

Fail to invoke the application method for a .NET 6 Web API project #214

Closed
v-ruizh opened this issue Dec 15, 2021 · 2 comments · Fixed by #222
Closed

Fail to invoke the application method for a .NET 6 Web API project #214

v-ruizh opened this issue Dec 15, 2021 · 2 comments · Fixed by #222
Labels
AT-CTI Issues found by internal test team bug Something isn't working
Milestone

Comments

@v-ruizh
Copy link

v-ruizh commented Dec 15, 2021

OS: Win10
Build Version: 20211202.11
.NET Version: 6.0.101
Regression: Not a Regression

Repro Steps:

  1. Create a new .NET 6.0 ASP.NET Web API application by "dotnet new webapi --no-https --name netwebapp".
  2. Open the application in VS Code -> Select "Dapr: Scaffold Dapr Tasks" from Command Palette -> Select ".NET Core Launch (web)" when asked to select a configuration -> Enter an application ID (Select the default "app") -> Enter an application port (Select the default "5000").
  3. Debug with configuration ".NET Core Launch (web) with Dapr".
  4. F1 -> Dapr: Invoke (GET) Application Method -> Select a Dapr application "app" -> Enter the application method "WeatherForecast" to invoke.
  5. Check whether the method is invoked or not.

Expect:
The method is invoked without any error.

Actual:
Fail to invoke the application method with an error "Request failed with status code 500".
image

More Info:

  1. This issue also reproduces on the previous released dapr extension.
  2. This issue does not reproduce for Node.js project.
  3. This issue does not reproduce for .NET 5 Web API project.
@v-ruizh v-ruizh added the AT-CTI Issues found by internal test team label Dec 15, 2021
@v-ruizh
Copy link
Author

v-ruizh commented Jan 10, 2022

This issue also reproduces on the latest dapr extension 20220108.1, it can be reproduced for both "Invoke (GET) Application Method" and "Invoke (POST) Application Method" actions.
It does not reproduce for "Publish Message to Application" action.

@philliphoff
Copy link
Collaborator

@v-ruizh The issue appears to be a change in the .NET 6 ASP.NET templates where they now select a random startup port rather than 5000. Since this is likely something all will run into, we should look at trying to sniff the selected port out of the launchSettings.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AT-CTI Issues found by internal test team bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants