Can't run the application #547
Replies: 5 comments 1 reply
-
I'm having the same error. Have you found a fix for it? |
Beta Was this translation helpful? Give feedback.
-
Me too. Exactly the same issue. Any ideas how to fix it? |
Beta Was this translation helpful? Give feedback.
-
I changed the sample's TargetFramework to net9.0 and it worked. Of course you need to install the visual studio preview version and net9 preview sdk first. |
Beta Was this translation helpful? Give feedback.
-
@hez2010 Can you provide any insight here? It's likely related to the PR: #493 which can't handle init-only properties until .net 9+. I'm not sure why this is coming up now for only some people though. |
Beta Was this translation helpful? Give feedback.
-
This will be fixed in 2.1 - already in that branch. *inserts grumpy remark about not being able to do simple things because .net team releases incomplete features* |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I try to run the app this error happened:
System.InvalidOperationException
HResult=0x80131509
Message=Deserialization of init-only properties is currently not supported in source generation mode.
Source=FAControlsGallery
StackTrace:
at FAControlsGallery.ViewModels.FAControlsJsonSerializerContext.<>c.b__34_3(Object obj, String value) in \FluentAvalonia-master\samples\FAControlsGallery\System.Text.Json.SourceGeneration\System.Text.Json.SourceGeneration.JsonSourceGenerator\FAControlsJsonSerializerContext.PageBaseViewModel.g.cs:line 85
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) at System.Text.Json.Serialization.JsonCollectionConverter
2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)at System.Text.Json.Serialization.JsonConverter
1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter
1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable
1 actualByteCount)at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan
1 json, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonTypeInfo
1 jsonTypeInfo)at FAControlsGallery.ViewModels.CoreControlsPageViewModel..ctor(String coreControlsJson) in \FluentAvalonia-master\samples\FAControlsGallery\ViewModels\CoreControlsPageViewModel.cs:line 12
at FAControlsGallery.Views.MainView.InitializeNavigationPages() in \FluentAvalonia-master\samples\FAControlsGallery\Views\MainView.axaml.cs:line 113
at FAControlsGallery.Views.MainView.b__1_0() in \FluentAvalonia-master\samples\FAControlsGallery\Views\MainView.axaml.cs:line 76
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in //src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 268
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in //src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 293
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in //src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2349
--- End of stack trace from previous location ---
at FluentAvalonia.UI.Windowing.SplashScreenContext.d__11.MoveNext() in \FluentAvalonia-master\src\FluentAvalonia\UI\Windowing\AppWindow\SplashScreenContext.cs:line 31
at FluentAvalonia.UI.Windowing.AppWindow.d__5.MoveNext() in \FluentAvalonia-master\src\FluentAvalonia\UI\Windowing\AppWindow\AppWindow.cs:line 167
at System.Threading.Tasks.Task.<>c.b__128_0(Object state) in //src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 1914
at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore()
at Avalonia.Threading.DispatcherOperation.Execute()
at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job)
at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback)
at Avalonia.Threading.Dispatcher.Signaled()
at Avalonia.Win32.Win32DispatcherImpl.DispatchWorkItem()
at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
at Avalonia.Win32.Win32DispatcherImpl.RunLoop(CancellationToken cancellationToken)
at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)
at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
at FAControlsGallery.Desktop.Program.Main(String[] args) in \FluentAvalonia-master\samples\FAControlsGallery.Desktop\Program.cs:line 12
Beta Was this translation helpful? Give feedback.
All reactions