AvaloniaRider icon indicating copy to clipboard operation
AvaloniaRider copied to clipboard

Customize default previewer project

Open stevemonaco opened this issue 10 months ago • 4 comments

When using the previewer in a crossplatform Avalonia app, the previewer will default to the first alphabetical project that's runnable. By default, this is "YourApp.Browser" instead of "YourApp.Desktop" which is not desirable as the previewer doesn't load. When changing, this selection seems to persist across sessions (close/reopen XAML file or open/close Rider), but only for the specific file.

Image

Mitigations: Unloading the browser project or renaming it.

Relevant code appears to be in this area: https://github.com/ForNeVeR/AvaloniaRider/blob/0414c7ab927e735be692d8941854ac6ddef104d1/src/rider/main/kotlin/me/fornever/avaloniarider/idea/editor/actions/RunnableAssemblySelectorAction.kt#L114-L164

stevemonaco avatar Feb 10 '25 02:02 stevemonaco

Yes, this is correct. Any idea what's wrong with the browser project so that it doesn't work?

I mean, is there some formal definition of the project in that it won't work?

ForNeVeR avatar Feb 10 '25 13:02 ForNeVeR

We probably need to expose some MSBuild property to indicate if previewer is available.

kekekeks avatar Feb 10 '25 17:02 kekekeks

In general netX.Y-browser TFMs are currently not previewable, the project needs to produce an actual runnable binary.

kekekeks avatar Feb 10 '25 17:02 kekekeks

Alright, this will work. I can hide projects that expose these TFMs. Or at least not choose them by default.

ForNeVeR avatar Feb 10 '25 20:02 ForNeVeR