Dotnet 8 maui ios NullabilityInfoContext wird nicht unterstützt

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Dotnet 8 maui ios NullabilityInfoContext wird nicht unterstützt

by Guest » 20 Jan 2025, 18:07

Ich habe eine Dotnet 8 Maui Blazor Hybrid-Anwendung, die ich auf einem iPad bereitstellen möchte.
Die Anwendung läuft problemlos unter Windows und iOS im Debug-Modus und über Visual Studio 2022.
Ich kann sie bereitstellen Ich lade die App im Debug-Modus auf das iPad und sie läuft einwandfrei.
Wenn ich die App im Release-Modus auf dem iPad bereitstelle (oder ein IPA erstelle), erhalte ich eine Ausnahme, wenn ich versuche, ein Objekt mit System.Text.Json zu serialisieren .
Dies geschieht nur bei der Bereitstellung im Release-Modus.

Code: Select all

NullabilityInfoContext_NotSupported
at System.Reflection.NullabilityInfoContext.EnsureIsSupported() at
System.Reflection.NullabilityInfoContext.Create(PropertyInfo ) at System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver.DeterminePropertyNullability(JsonPropertyInfo, MemberInfo, NullabilityInfoContext) at ...
Ich habe dies im MauiProgram CreateMauiApp()

Code: Select all

AppContext.SetSwitch("System.Reflection.NullabilityInfoContext.IsSupported", true);
Ich habe versucht, dies zum csproj hinzuzufügen, aber die App wird nicht geladen (es wird der Begrüßungsbildschirm angezeigt und dann eingeblendet)

Code: Select all

true
Hat noch jemand eine Lösung dafür gefunden?

Top