'Can ASP.NET CORE MVC be hosted in Xamarin App(Android)?
I have a ASP.NET CORE MVC (.NET CORE 3.1) application running well on Kestrel in Windows, Now I'm wondering if possible to migrate it to Android via Xamarin?
The purpose of this move is the lower cost of Android device.
And I noticed: Run ASP.NET Core 3.0 apps with MonoVM but seems no details?
Solution 1:[1]
No, Not yet (Jan 2021).
Xamarin, NetFramework, Net5, NetCore3 all support NetStandard. AspNetCore is based on NetCore, not NetStandard. If AspNetCore was a NetStandard library, it would support it, but AspNetCore uses other libraries in NetCore which do not exist on Xamarin.
By the way, if you need just a simple web server running on android like Kestrel, you can use EmdedIO. Indeed it doesn't support MVC, MVP, and MVVM, so you can not run AspNetCore app on Xamarin: https://github.com/unosquare/embedio
Solution 2:[2]
As of April 2021, looks like this guy was able to run it on Net Core 5 with some minor modifications. https://melihercan.medium.com/running-net-core-web-host-and-kestrel-server-on-xamarin-forms-apps-2c5e3a3df5a5
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Mohammad Nikravan |
Solution 2 | corradolab |