dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.92k stars 479 forks source link

Exception thrown on startup for AppHost #5205

Open GrantByrn3 opened 3 months ago

GrantByrn3 commented 3 months ago

Is there an existing issue for this?

Describe the bug

Currently trying to run my existing .net aspire app in Fedora Linux. This project is currently working in windows and on the our Ubuntu build server.

When I try to start up the project I get the following exception stack track:

System.AggregateException: One or more errors occurred. (Property DashboardPath: The path to the Aspire Dashboard binaries is missing.)
 ---> Microsoft.Extensions.Options.OptionsValidationException: Property DashboardPath: The path to the Aspire Dashboard binaries is missing.
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at Microsoft.Extensions.Options.UnnamedOptionsManager`1.get_Value()
   at Aspire.Hosting.Dashboard.ConfigureDefaultDashboardOptions.Configure(DashboardOptions options) in /_/src/Aspire.Hosting/Dashboard/DashboardOptions.cs:line 25
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at Microsoft.Extensions.Options.UnnamedOptionsManager`1.get_Value()
   at Aspire.Hosting.Dashboard.DashboardLifecycleHook.AddDashboardResource(DistributedApplicationModel model) in /_/src/Aspire.Hosting/Dashboard/DashboardLifecycleHook.cs:line 77
   at Aspire.Hosting.Dashboard.DashboardLifecycleHook.BeforeStartAsync(DistributedApplicationModel model, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dashboard/DashboardLifecycleHook.cs:line 46
   at Aspire.Hosting.DistributedApplication.ExecuteBeforeStartHooksAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 353
   at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 309
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Aspire.Hosting.DistributedApplication.Run() in /_/src/Aspire.Hosting/DistributedApplication.cs:line 338
   at Program.<Main>$(String[] args) in /home/grant/Code/Billing/TswCloud.Billing.AppHost/Program.cs:line 79

Here are my launch settings:

{
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "profiles": {
    "https": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "https://localhost:17188",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "DOTNET_ENVIRONMENT": "Development",
        "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21188",
        "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22188"
      }
    }
  }
}

When I list the dotnet workloads, I get this:

dotnet workload list

Installed Workload Id      Manifest Version                     Installation Source
-----------------------------------------------------------------------------------
aspire                     8.0.0-preview.1.23557.2/8.0.100      SDK 8.0.100        

Use `dotnet workload search` to find additional workloads to install.

Updates are available for the following workload(s): aspire. Run `dotnet workload update` to get the latest.

Running the command dotnet workload update says it updated it, but does not report as updated.

Expected Behavior

For the app to start up and show me the dashboard.

Steps To Reproduce

Run dotnet run for the apphost project

Exceptions (if any)

System.AggregateException: One or more errors occurred. (Property DashboardPath: The path to the Aspire Dashboard binaries is missing.)
 ---> Microsoft.Extensions.Options.OptionsValidationException: Property DashboardPath: The path to the Aspire Dashboard binaries is missing.
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at Microsoft.Extensions.Options.UnnamedOptionsManager`1.get_Value()
   at Aspire.Hosting.Dashboard.ConfigureDefaultDashboardOptions.Configure(DashboardOptions options) in /_/src/Aspire.Hosting/Dashboard/DashboardOptions.cs:line 25
   at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   at Microsoft.Extensions.Options.UnnamedOptionsManager`1.get_Value()
   at Aspire.Hosting.Dashboard.DashboardLifecycleHook.AddDashboardResource(DistributedApplicationModel model) in /_/src/Aspire.Hosting/Dashboard/DashboardLifecycleHook.cs:line 77
   at Aspire.Hosting.Dashboard.DashboardLifecycleHook.BeforeStartAsync(DistributedApplicationModel model, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dashboard/DashboardLifecycleHook.cs:line 46
   at Aspire.Hosting.DistributedApplication.ExecuteBeforeStartHooksAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 353
   at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 309
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at Aspire.Hosting.DistributedApplication.Run() in /_/src/Aspire.Hosting/DistributedApplication.cs:line 338
   at Program.<Main>$(String[] args) in /home/grant/Code/Billing/TswCloud.Billing.AppHost/Program.cs:line 79

.NET Version info

dotnet --info
.NET SDK:
 Version:           8.0.105
 Commit:            eae90abaaf
 Workload version:  8.0.303-baseline.24317.8

Runtime Environment:
 OS Name:     fedora
 OS Version:  40
 OS Platform: Linux
 RID:         fedora.40-x64
 Base Path:   /usr/lib64/dotnet/sdk/8.0.105/

.NET workloads installed:
 Workload version: 8.0.303-baseline.24317.8
 [aspire]
   Installation Source: SDK 8.0.100
   Manifest Version:    8.0.0-preview.1.23557.2/8.0.100
   Manifest Path:       /home/grant/.dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.aspire/8.0.0-preview.1.23557.2/WorkloadManifest.json
   Install Type:        FileBased

Host:
  Version:      8.0.5
  Architecture: x64
  Commit:       087e15321b

.NET SDKs installed:
  8.0.105 [/usr/lib64/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.5 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.5 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/lib64/dotnet]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Anything else?

No response

davidfowl commented 3 months ago

You have a really old aspire workload version installed.

cc @joperezr

joperezr commented 3 months ago

Right. Can you please run:

dotnet workload update
dotnet workload install aspire
GrantByrn3 commented 3 months ago

@joperezr - This is really confusing. Running those commands doesn't appear to change anything.

grant@fedora:~$ dotnet workload update

Skipping NuGet package signature verification.
Updated advertising manifest microsoft.net.workload.emscripten.net7.
Updated advertising manifest microsoft.net.sdk.ios.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net6.
Updated advertising manifest microsoft.net.workload.emscripten.current.
Updated advertising manifest microsoft.net.sdk.tvos.
Updated advertising manifest microsoft.net.workload.emscripten.net6.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net7.
Updated advertising manifest microsoft.net.sdk.maccatalyst.
Updated advertising manifest microsoft.net.workload.mono.toolchain.current.
Updated advertising manifest microsoft.net.sdk.macos.
Updated advertising manifest microsoft.net.sdk.android.
Updated advertising manifest microsoft.net.sdk.maui.
Updated advertising manifest microsoft.net.sdk.aspire.
Installing workload manifest microsoft.net.sdk.aspire version 8.1.0...
Installing workload manifest microsoft.net.sdk.android version 34.0.113...
Installing workload manifest microsoft.net.sdk.ios version 17.5.8020...
Installing workload manifest microsoft.net.sdk.maccatalyst version 17.5.8020...
Installing workload manifest microsoft.net.sdk.macos version 14.5.8020...
Installing workload manifest microsoft.net.sdk.maui version 8.0.72...
Installing workload manifest microsoft.net.sdk.tvos version 17.5.8020...
Installing pack Aspire.Hosting.Sdk version 8.0.0-preview.1.23557.2...
Pack Aspire.Hosting.Sdk version 8.0.0-preview.1.23557.2 is already installed.
Writing workload pack installation record for Aspire.Hosting.Sdk version 8.0.0-preview.1.23557.2...
Installing pack Aspire.ProjectTemplates version 8.0.0-preview.1.23557.2...
Pack Aspire.ProjectTemplates version 8.0.0-preview.1.23557.2 is already installed.
Writing workload pack installation record for Aspire.ProjectTemplates version 8.0.0-preview.1.23557.2...
Installing pack Aspire.Hosting.Orchestration.linux-x64 version 8.0.0-preview.1.23557.2...
Pack Aspire.Hosting.Orchestration.linux-x64 version 8.0.0-preview.1.23557.2 is already installed.
Writing workload pack installation record for Aspire.Hosting.Orchestration version 8.0.0-preview.1.23557.2...
Installing pack Aspire.Hosting version 8.0.0-preview.1.23557.2...
Pack Aspire.Hosting version 8.0.0-preview.1.23557.2 is already installed.
Writing workload pack installation record for Aspire.Hosting version 8.0.0-preview.1.23557.2...
Garbage collecting for SDK feature band(s) 8.0.100...
Uninstalling workload manifest microsoft.net.sdk.aspire version 8.1.0/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.android version 34.0.113/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.ios version 17.5.8020/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.maccatalyst version 17.5.8020/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.macos version 14.5.8020/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.maui version 8.0.72/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.tvos version 17.5.8020/8.0.100...

Successfully updated workload(s): aspire.
grant@fedora:~$ dotnet workload install aspire

Workload(s) 'aspire' are already installed.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Installing workload manifest microsoft.net.sdk.aspire version 8.1.0...
Installing workload manifest microsoft.net.sdk.android version 34.0.113...
Installing workload manifest microsoft.net.sdk.ios version 17.5.8020...
Installing workload manifest microsoft.net.sdk.maccatalyst version 17.5.8020...
Installing workload manifest microsoft.net.sdk.macos version 14.5.8020...
Installing workload manifest microsoft.net.sdk.maui version 8.0.72...
Installing workload manifest microsoft.net.sdk.tvos version 17.5.8020...
Installing pack Aspire.Hosting.Sdk version 8.0.0-preview.1.23557.2...
Pack Aspire.Hosting.Sdk version 8.0.0-preview.1.23557.2 is already installed.
Writing workload pack installation record for Aspire.Hosting.Sdk version 8.0.0-preview.1.23557.2...
Installing pack Aspire.ProjectTemplates version 8.0.0-preview.1.23557.2...
Pack Aspire.ProjectTemplates version 8.0.0-preview.1.23557.2 is already installed.
Writing workload pack installation record for Aspire.ProjectTemplates version 8.0.0-preview.1.23557.2...
Installing pack Aspire.Hosting.Orchestration.linux-x64 version 8.0.0-preview.1.23557.2...
Pack Aspire.Hosting.Orchestration.linux-x64 version 8.0.0-preview.1.23557.2 is already installed.
Writing workload pack installation record for Aspire.Hosting.Orchestration version 8.0.0-preview.1.23557.2...
Installing pack Aspire.Hosting version 8.0.0-preview.1.23557.2...
Pack Aspire.Hosting version 8.0.0-preview.1.23557.2 is already installed.
Writing workload pack installation record for Aspire.Hosting version 8.0.0-preview.1.23557.2...
Garbage collecting for SDK feature band(s) 8.0.100...
Uninstalling workload manifest microsoft.net.sdk.aspire version 8.1.0/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.android version 34.0.113/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.ios version 17.5.8020/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.maccatalyst version 17.5.8020/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.macos version 14.5.8020/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.maui version 8.0.72/8.0.100...
Uninstalling workload manifest microsoft.net.sdk.tvos version 17.5.8020/8.0.100...

Successfully installed workload(s) aspire.
grant@fedora:~$ dotnet workload list

Installed Workload Id      Manifest Version                     Installation Source
-----------------------------------------------------------------------------------
aspire                     8.0.0-preview.1.23557.2/8.0.100      SDK 8.0.100        

Use `dotnet workload search` to find additional workloads to install.

Updates are available for the following workload(s): aspire. Run `dotnet workload update` to get the latest.
GrantByrn3 commented 3 months ago

I was able to find a workaround with this. For whatever reason something is messed up with the version of .net that is install on my machine and I don't have a built in mechanism to update dotnet to the latest version.

My workaround here is to run through the dotnet install script guide here: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install

This install a newer version of dotnet in my /home directory. I installed the latest workload via that dotnet install and then pointed Jetbrains Rider to use that version. Now, I'm back up and running.