Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<PublishAot> prevents AXAML previewer from working #19

Open
MikeyWetzel opened this issue Jan 13, 2025 · 2 comments
Open

<PublishAot> prevents AXAML previewer from working #19

MikeyWetzel opened this issue Jan 13, 2025 · 2 comments

Comments

@MikeyWetzel
Copy link

MikeyWetzel commented Jan 13, 2025

A fresh git clone and build of the solution in VS2022 results in none of the .axaml files working in the preview. The error shown is "Dynamic code generation is not supported on this platform."

I did a google search and found AvaloniaUI/Avalonia#13760 where a commenter suggested: "Well, previewer cannot be supported with PublishAot binaries, as AOT doesn't support dynamic code which is essential for the previewer."
I can verify the following suggestion did fix the problem. That fix is to add this line in Solitaire.Desktop.csproj:

	<PublishAot Condition="'$(Configuration)' != 'Debug'" >true</PublishAot>

Result: axaml files new appear at design time.

@MikeyWetzel
Copy link
Author

Well, I'm not entirely working here. The fix about gets CasionView.axaml working, but App.axaml still shows the error.

@stevemonaco
Copy link

Application is explicitly not supported, I presume by design. See https://github.com/AvaloniaUI/Avalonia/blob/03f91a2c3d20160dad7dd60961ac272cc16f39aa/src/Avalonia.DesignerSupport/DesignWindowLoader.cs#L92-L93

There's not much value here to be had either, IMO, unless somebody needs to preview a multiwindow app at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants