DEV Community

Cover image for Google Chromecast in .NET MAUI
Victor Hugo Garcia
Victor Hugo Garcia

Posted on • Updated on

Google Chromecast in .NET MAUI

Are you looking for a way to stream live or on-demand videos from your .NET MAUI app to a Google Cast device? In this post, you will learn how to find and connect to Chromecast devices in just 9 minutes. Ready to cast your videos?

Special thanks to our friend Gerald who shared with us this amazing article which helped me to integrate the Chromecast support into my .NET MAUI apps.

Required packages and project conditions

  • Add the NuGet packages required to enable Google Cast on iOS and Android or edit the .csproj file and set them up there:


    <PackageReference Include="protobuf-net" Version="3.2.26" />

Enter fullscreen mode Exit fullscreen mode


<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
        <PackageReference Include="Xamarin.GooglePlayServices.Cast" Version="121.1.0" />
        <PackageReference Include="Xamarin.GooglePlayServices.Cast.Framework" Version="121.1.0" />
Enter fullscreen mode Exit fullscreen mode


<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-ios'">
        <PackageReference Include="Xamarin.Google.iOS.Cast" Version="" />
Enter fullscreen mode Exit fullscreen mode

Required Workarounds

Well, let me share with you some news, the package Google Cast on NuGet is really cool, however, there are 2 issues with this package, and just to be clear I'm not blaming anybody, totally the opposite, I would like to thank you all people involved on those packages and their dependencies.

The Google Cast package has a dependency on the Zeroconf package, however, the Zeroconf package has an issue on iOS 16+, lucky us our friend Martin created a Pull-Request on the Zeroconf repository which fixes the iOS 16+ issues when discovering Chromecast devices within the network.

My recommendation is to download or clone the following Pull-Request and then add as reference this project into your .NET MAUI application. See the important note below:

Update the .csproj from the ZeroConf project and replace the following:


Enter fullscreen mode Exit fullscreen mode


Enter fullscreen mode Exit fullscreen mode

Finally, close the solution and re-open it, make sure there are not errors when trying to restore the packages and you will be set.

One Last Workaround

Since we are going to use the project we cloned from Zeroconf, the Google Cast NuGet package, won't work. So, we need to also clone the latest main version of the repository and convert the project to a .NET MAUI compatible class library or if you prefer, add all the source files from Google Cast repository, directly in your .NET MAUI project and that's all.

What's next?

From this point the .NET MAUI implementation is pretty much the same as our friend Gerald shared on his post, so I recommend you to take a look there, it is really easy to implement either directly on a Content Page or using MVVM.


Due to a missing compatibility of a dependency with iOS 16, we are forced to look back until we figure out the root cause of the issue. I think this is an opportunity to learn more and improve my skills. When the Zeroconf package updates to support iOS 16, we can just use the new version and it will replace the one used by the Google Cast package.

Thanks for reading! Follow me on Twitter @ivictorhugo

Top comments (0)