Granted, ASP.NET Core doesn't have a SynchronizationContext, so that happens no matter what. Well, unless you create your own SynchronizationContext there for some reason.
So say AddCompletions is a library method (it effectively is), then you want .ConfigureAwait(false) on each call so it can resume on any available thread.
XAML can pull from many sources, including from objects created by C# at runtime. So it is hard to keep a designer/previewer happy and usable even if one exists for your GUI framework.
Isolating it into its own reusable project (within the same solution) is best. If you can't do that, then the best you can do is: 1. create separate Avalonia project. 2. reference business + WPF project from it. 3. hope that the isolation works.
It seems like too niche of a scenario for JetBrains to add specific support for, but you could always open a ticket for them to see if there are any mitigations.