AvaloniaUI / AvaloniaVS

Visual Studio Extension for Avalonia
MIT License
421 stars 81 forks source link

Visual Editor stuck in error when ViewModel has multiple constructors #379

Open FirehawkV21 opened 1 year ago

FirehawkV21 commented 1 year ago

Describe the bug

I was working on a project and one of the view models needed a different constructor to initialize it properly. After putting the required constructor, the VSIX extension thew an error that it couldn't find ViewModel();. After putting the required constructor, the VSIX extension throws an error, but I don't see it in the Error List. The app compiles normally.

To Reproduce

AvaloniaVS plugin version

11.1

Avalonia version

11.0.4

Visual Studio version

17.7.1

Relevant log output

20:01:01.387 [Information]  Starting previewer process for '"E:\repos\Dragonhouse.RMCookToolDeluxe\artifacts\bin\Dragonhouse.RMCookToolDeluxe.GUI\debug\Dragonhouse.RMCookToolDeluxe.GUI.dll"'
20:01:01.428 [Information] 153132 Started previewer process for '"E:\repos\Dragonhouse.RMCookToolDeluxe\artifacts\bin\Dragonhouse.RMCookToolDeluxe.GUI\debug\Dragonhouse.RMCookToolDeluxe.GUI.dll"'. Waiting for connection to be initialized.
20:01:02.229 [Information] 153132 Connection initialized
20:01:06.595 [Error] 153132 UpdateXamlResult error
System.Xaml.XamlException: Object reference not set to an instance of an object.

Additional context

I was able to check this in a .NET 8 project. Haven't tested on older versions. The necessary xaml code for datacontext is present.