Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Adding .Net Aspire to Existing Blazor Server App

$
0
0

I have a Blazor Server .Net 8 web application. I right-click on the Blazor sever project and select "Add" then ".Net Aspire Orchestrator Support".

This added the two Projects (AppHost, and Service Defaults) to my solution. The AppHost project is selected as the start-up project. When I run the app in Debug mode it fails and I am getting the below-attached error.

Any idea what is wrong? It seems it's trying to convert a string to a boolean.

When I debug my app normally without using Aspire, I use IIS Express in Visual Studio

If it helps this is the full error msg

System.Text.Json.JsonExceptionHResult=0x80131500Message=The JSON value could not be converted to System.Nullable1[System.Boolean]. Path: $.profiles.DptBlazor.dotnetRunMessages | LineNumber: 27 | BytePositionInLine: 33. Source=System.Text.Json StackTrace: at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.ContinueDeserialize(ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack) at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.Deserialize(Stream utf8Json)at Aspire.Hosting.LaunchProfileExtensions.GetLaunchSettings(IProjectMetadata projectMetadata)at Aspire.Hosting.LaunchProfileExtensions.GetLaunchSettings(ProjectResource projectResource)at Aspire.Hosting.LaunchProfileExtensions.TrySelectLaunchProfileFromEnvironment(ProjectResource projectResource, String& launchProfileName)at Aspire.Hosting.LaunchProfileExtensions.SelectLaunchProfileName(ProjectResource projectResource)at Aspire.Hosting.LaunchProfileExtensions.GetEffectiveLaunchProfile(ProjectResource projectResource, Boolean throwIfNotFound)at Aspire.Hosting.ProjectResourceBuilderExtensions.WithProjectDefaults(IResourceBuilder`1 builder, Boolean excludeLaunchProfile, String launchProfileName)at Aspire.Hosting.ProjectResourceBuilderExtensions.AddProject[TProject](IDistributedApplicationBuilder builder, String name)at Program.$(String[] args) in C:\inetpub\wwwroot\MyApp\Dpt.AppHost\Program.cs:line 3

This exception was originally thrown at this call stack:[External Code]

Inner Exception 1:InvalidOperationException: Cannot get the value of a token type 'String' as a boolean.

Many thanks in advance

enter image description here

Im using IIS Express when I run it without Aspire and it works fine. But when I try and use Aspire i get the errorenter image description here


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>