dotnet / aspire-samples

MIT License
571 stars 158 forks source link

[WebToolsE2E][Aspire] When turning on the "Auto refresh" button of the weather page on the Metrics sample, an error appears in the console logs: System.InvalidOperationException: Error getting weather data. #260

Open v-sherryfan opened 2 months ago

v-sherryfan commented 2 months ago

REGRESSION INFO: Also repro on Aspire 8.0 P6

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install VS 17.10 Preview 7 [ Includes Aspire 8.0.0-preview.7.24251.11 and SDK 8.0.300-preview.24203.14 ]
  3. Apply NuGet dotnet-tools Feed
  4. Install Docker Desktop for Windows
  5. Install latest azd [1.9.0-beta.1-daily.3760115]

REPRO STEPS

  1. Clone aspire-samples repo, checkout the release/8.0 branch
  2. Open samples\Metrics.sln
  3. Build and run (F5 / Ctrl+F5)
  4. Go to "Auth Required" page on Metrics sample > click 'Log in' to log into your account
  5. Then go to "Weather" page > turn on the "Auto refresh" button
  6. Go back to "Console logs" tab on dashboard, select "app" in dropdown list

ACTUAL fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. System.InvalidOperationException: Error getting weather data. at MetricsApp.ClientApi.<>c.<b__1_0>d.MoveNext() in C:\Users\v-sherryfan\source\repos\aspire-samples\samples\Metrics\MetricsApp\ClientApi.cs:line 18 --- End of stack trace from previous location --- at Microsoft.AspNetCore.Http.RequestDelegateFactory.g__ExecuteAwaited|132_0[T](Task1 task, HttpContext httpContext, JsonTypeInfo1 jsonTypeInfo) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) image

EXPECTED

There is no any errors in the console logs when turning on the "Auto refresh" button for the weather page