Skip to content

Json issue at launch #2339

@Julien-Marpault

Description

@Julien-Marpault

I have two projects, one SSO and one Blazor WASM app backed by a .Net backend.
Thes two projects uses last version of .Net 8 and everything is up to date.

When I use Aspire to launch the web application everything works fine, but if I add the SSO I get this error:

Unhandled exception. System.AggregateException: One or more errors occurred. (The JSON value could not be converted to System.Nullable`1[System.Boolean]. Path: $.profiles.https.dotnetRunMessages | LineNumber: 4 | BytePositionInLine: 33.)
 ---> System.Text.Json.JsonException: The JSON value could not be converted to System.Nullable`1[System.Boolean]. Path: $.profiles.https.dotnetRunMessages | LineNumber: 4 | BytePositionInLine: 33.
 ---> System.InvalidOperationException: Cannot get the value of a token type 'String' as a boolean.
   at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType)
   at System.Text.Json.Utf8JsonReader.GetBoolean()
   at System.Text.Json.Serialization.Converters.NullableConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonDictionaryConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TDictionary& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   --- End of inner exception stack trace ---
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.ContinueDeserialize(ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Deserialize(Stream utf8Json)
   at Aspire.Hosting.LaunchProfileExtensions.GetLaunchSettings(IProjectMetadata projectMetadata) in /_/src/Aspire.Hosting/Utils/LaunchProfileExtensions.cs:line 65
   at Aspire.Hosting.LaunchProfileExtensions.GetLaunchSettings(ProjectResource projectResource) in /_/src/Aspire.Hosting/Utils/LaunchProfileExtensions.cs:line 22
   at Aspire.Hosting.LaunchProfileExtensions.TrySelectLaunchProfileFromEnvironment(ProjectResource projectResource, String& launchProfileName) in /_/src/Aspire.Hosting/Utils/LaunchProfileExtensions.cs:line 100
   at Aspire.Hosting.LaunchProfileExtensions.SelectLaunchProfileName(ProjectResource projectResource) in /_/src/Aspire.Hosting/Utils/LaunchProfileExtensions.cs:line 135
   at Aspire.Hosting.LaunchProfileExtensions.GetEffectiveLaunchProfile(ProjectResource projectResource) in /_/src/Aspire.Hosting/Utils/LaunchProfileExtensions.cs:line 27
   at Aspire.Hosting.Dcp.DcpDistributedApplicationLifecycleHook.PrepareServices(DistributedApplicationModel model) in /_/src/Aspire.Hosting/Dcp/DcpDistributedApplicationLifecycleHook.cs:line 33
   at Aspire.Hosting.Dcp.DcpDistributedApplicationLifecycleHook.BeforeStartAsync(DistributedApplicationModel appModel, CancellationToken cancellationToken) in /_/src/Aspire.Hosting/Dcp/DcpDistributedApplicationLifecycleHook.cs:line 22
   at Aspire.Hosting.DistributedApplication.ExecuteBeforeStartHooksAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 150
   at Aspire.Hosting.DistributedApplication.RunAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 127
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   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 136
   at Program.<Main>$(String[] args) in C:\Azure DevOps\Graphene\Graphene.BackOffice\Graphene.Launcher\Graphene.Launcher.AppHost\Program.cs:line 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions