dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 151 forks source link

Blazor Hybrid template creates a windows project that is not compatible with Xamarin.Essentials #282

Open Eilon opened 3 years ago

Eilon commented 3 years ago

Issue moved from Eilon/MobileBlazorBindingsMigration#1


From @MattBigYellowDesign on Tuesday, December 29, 2020 6:06:40 PM

Creating a blazorhybrid app generates a number of sub projects, one for each deployment platform. The UWP project compiles and runs once edge canary is installed, however when attempting to use Xamarin.Essentials it has a runtime notimplemented exception, with the text :-

"This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation"

Looking closely at the template, it is a WPF project, not a UWP one, explaining why the runtime notimpl exceptions are thrown.

Android project can successfully use Xamarin Essentials.

Can the template be updated to improve the new-user experience such that Xamarin Essentials can be used across all platforms, not just the android/apple ones?

Many thanks

Matt

Eilon commented 3 years ago

Issue moved from Eilon/MobileBlazorBindingsMigration#1


From @Eilon on Tuesday, January 5, 2021 5:59:18 PM

Interesting! I wasn't aware that WPF didn't have almost any support on Xamarin.Essentials yet. It's not listed as a supported platform here: https://docs.microsoft.com/en-us/xamarin/essentials/platform-feature-support?context=xamarin/xamarin-forms

But it looks like there's a big PR in progress here to add WPF support: https://github.com/xamarin/Essentials/pull/1079

So once that's available, it should enable these scenarios for all Xamarin-based apps, including Mobile Blazor Bindings.