Aspire.ResourceServer.Standalone icon indicating copy to clipboard operation
Aspire.ResourceServer.Standalone copied to clipboard

Null Reference Exception when running on Aprire Dashboard version 9.2

Open ricohomewood opened this issue 11 months ago • 1 comments

When running the Resource Server with the latest versions of the Aspire dashboard 9.2 you get an exception in the Aspire dashboard:

fail: Aspire.Dashboard.Model.DashboardClient[0]
      Error loading data from the resource service.
      System.InvalidOperationException: Error converting resource "/aspire-dashboard" to ResourceViewModel.
       ---> System.NullReferenceException: Object reference not set to an instance of an object.
         at Aspire.ResourceService.Proto.V1.Resource.<ToViewModel>g__TranslateKnownUrlName|0_10(Url url) in /_/src/Aspire.Dashboard/ResourceService/Partials.cs:line 84
         at Aspire.ResourceService.Proto.V1.Resource.<>c.<ToViewModel>b__0_13(<>f__AnonymousType1`2 <>h__TransparentIdentifier0) in /_/src/Aspire.Dashboard/ResourceService/Partials.cs:line 95
         at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.ToArray()
         at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
         at Aspire.ResourceService.Proto.V1.Resource.<ToViewModel>g__GetUrls|0_4() in /_/src/Aspire.Dashboard/ResourceService/Partials.cs:line 92
         at Aspire.ResourceService.Proto.V1.Resource.ToViewModel(IKnownPropertyLookup knownPropertyLookup, ILogger logger) in /_/src/Aspire.Dashboard/ResourceService/Partials.cs:line 23
         --- End of inner exception stack trace ---
         at Aspire.ResourceService.Proto.V1.Resource.ToViewModel(IKnownPropertyLookup knownPropertyLookup, ILogger logger) in /_/src/Aspire.Dashboard/ResourceService/Partials.cs:line 47
         at Aspire.Dashboard.Model.DashboardClient.<>c__DisplayClass28_1.<<EnsureInitialized>g__WatchResourcesAsync|5>d.MoveNext() in /_/src/Aspire.Dashboard/ResourceService/DashboardClient.cs:line 338
      --- End of stack trace from previous location ---
         at Aspire.Dashboard.Model.DashboardClient.<>c__DisplayClass28_1.<<EnsureInitialized>g__WatchResourcesAsync|5>d.MoveNext() in /_/src/Aspire.Dashboard/ResourceService/DashboardClient.cs:line 319
      --- End of stack trace from previous location ---
         at Aspire.Dashboard.Model.DashboardClient.<>c__DisplayClass28_0.<<EnsureInitialized>g__WatchResourcesWithRecoveryAsync|3>d.MoveNext() in /_/src/Aspire.Dashboard/ResourceService/DashboardClient.cs:line 294
      --- End of stack trace from previous location ---
         at Aspire.Dashboard.Model.DashboardClient.<EnsureInitialized>g__ConnectAndWatchResourcesAsync|28_1(CancellationToken cancellationToken) in /_/src/Aspire.Dashboard/ResourceService/DashboardClient.cs:line

Seems the latest Aspire dashboard have added the ResourceGraph for which this may need to implement?

ricohomewood avatar May 21 '25 09:05 ricohomewood

Thank you for reporting the issue. You might be right. I'll address this ASAP.

I appreciate your contribution.

kiapanahi avatar May 21 '25 14:05 kiapanahi

@ricohomewood This is fixed now with #43

codingzerotohero avatar Jun 16 '25 21:06 codingzerotohero