DEV Community

Cover image for .Net core host builder for Xamarin? Yes please!
Matt Hope
Matt Hope

Posted on • Edited on • Originally published at matt-h.dev

1

.Net core host builder for Xamarin? Yes please!

This year I decided to embark on the journey of developing a .Net Core style host builder for Xamarin. I had previously seen examples using the HostBuilder provided by the .Net Core framework. While this approach was perfectly fine and works as intended, I found myself wanting something a little more integrated with Xamarin. Enter Hostly, a framework that provides end-users with a custom Ihost tailored to Xamarin.Forms. It's as simple as running a few lines of code in your entry class (FormsAppCompatActivity in Android, or FormsApplicationDelegate in iOS):

new XamarinHostBuilder().UseApplication<App>()
.UsePlatform(this)
.Build()
.StartAsync();
Enter fullscreen mode Exit fullscreen mode

Using Hostly opens up access to a rich set of useful features when developing a Xamarin app. A few of those being:

  • Navigation Middleware
  • Lifecycle Middleware (In progress)
  • Dependency Injection
  • EF.Core
  • Hosted services

Try it out for yourself here

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Sentry mobile image

Mobile Vitals: A first step to Faster Apps

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read the guide →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay