AvaloniaVS icon indicating copy to clipboard operation
AvaloniaVS copied to clipboard

Always getting NullReferenceException from UpdateXamlResultMessage

Open tkefauver opened this issue 1 year ago • 3 comments

Describe the bug

I've tried a million times to get Avalonia previewer working but always get "Invalid Markup" with Avalonia Diagnostics showing error below.

Even with a default user control created from the template its always the same and the log doesn't show any exception details, just '...' so I can't narrow the problem down.

Strangely enough Previewer works fine if I create a new project but not in my actual solution. Any suggestions how to fix this or is this a known issue perhaps?

To Reproduce

Hard to say, but possibly create an old 0.10 project template and update it manually to 0.11 then create a new user control and build.

AvaloniaVS plugin version

11.5

Avalonia version

11.0.5

Visual Studio version

17.7.6

Relevant log output

[Debug] 15816 <= UpdateXamlResultMessage { Error: "System.NullReferenceException: …", Handle: null, Exception: ExceptionDetails { ExceptionType: "NullReferenceException", Message: "Object reference not set to an …", LineNumber: null, LinePosition: null } }

Additional context

In the log before the error is this line: [Debug] 25740 <= "Obtaining AppBuilder instance from <Class library namespace>.Program" Which maybe fine but the class library doesn't have program in it.

Besides the "Invalid Markup" message, when the previewer shows the "Build Required" error it has a malformed .dll path listed where its always looking in bin\x86\Release even when building in "Debug | Any CPU". In my solution the platform comes after configuration so it should be bin\Release\x86 so that maybe a real clue to what the bug is.

tkefauver avatar Nov 11 '23 17:11 tkefauver