AvaloniaVS icon indicating copy to clipboard operation
AvaloniaVS copied to clipboard

When compiling with a multi-target framework, Avalonia's window UI does not preview properly

Open pkq520 opened this issue 1 year ago • 1 comments

Describe the bug

I use the class library of frmework4.8 with net8.0 multi-target framework, where frmework4.8's UI designer works fine, but Avalonia's UI can't be previewed, but the project compiles normally.

To Reproduce

类库框架的项目设置为 d2876746-f42d-4d33-b0cf-5857e37aceda VS上的错误像这样 956a173a-14a9-48ca-a31b-200cbe5b06c2

Expected behavior

It will be the same as what I see in my photo, the UI can't be previewed, but it compiles fine 85ee52e3-6f9c-4ad7-bcac-babc5fe30d23

Avalonia version

11.1.0

OS

Windows

Additional context

No response

pkq520 avatar Nov 20 '24 03:11 pkq520

Use of the Previewer requires a desktop build of the app. Try also adding a reference to the Avalonia.Desktop package as part of the net8.0 build.

    <PackageReference Include="Avalonia.Desktop" Version="11.3.4" />

mrlacey avatar Sep 10 '25 13:09 mrlacey