AvaloniaUI / AvaloniaVS

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

Always getting NullReferenceException from UpdateXamlResultMessage #416

Open tkefauver opened 10 months ago

tkefauver commented 10 months ago

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.

Takoooooo commented 10 months ago

Hey, maybe you upload your project to GitHub and i will be able test it and fix the problem?

tkefauver commented 9 months ago

I was just hoping for a "delete your obj/bin folder" or some hints really. Its not open source but appreciate the thought :)

Takoooooo commented 9 months ago

I am guessing that the problem is on the Avalonia side so hints may not work ;(