2
votes

I have started a Xamarin.Forms cross-platform project in VS 2019, Android + iOS + UWP.

I need to use Xamarin.Essentials.FilePicker and Xamarin.Essentials.MediaPicker classes. The problem is that FilePicker and MediaPicker classes are not available in my Xamarin.Essentials namespace...

VS is Professional 2019, version 16.7.7 - Fully updated. Common project target is .NET Standard 2.0. Nuget package installed is Xamarin.Essentials v1.5.3.2. Android target platform is Android 0.0 (Pie). iOS SDK version is Default (no setup done at all). UWP min version is Qindows 10 Fall Creators Update, target version is Windows 10 version 1903 (compilation 18362).

I've reinstalled Nuget package, restored it, cleaned an recompiled entire solution...

When I write in any common project class (or platform-specific project) "Xamarin.Essentials.", the intellisense displays several available classes, but MediaPicker or FilePicker won't appear. See this screenshot:

Screenshot showing Xamarin.Essentials intellisense classes - MediaPicker not present

If I let Xamarin.Essentials.MediaPicker, VS complains that "The type or namespace 'MediaPicker' does not exist in namespace 'Xamarin.Essentials' (Missing assembly reference?)

An hint is that if I start a clean new Xamarin.Forms cross-platforms, these classes aren't available, too. If I create an Android-only or iOS-only Xamarin.Forms project, these classes are also not available.

¿Should I reinstall VS, review some assemby references (and where?), ...?

Note: I know there are NuGet packages that supply these functionalities, but I want to adhere to "basic standard" when possible...

1
both of these classes are introduced in Essential 1.6, which is in pre-releaseJason
Oh, my, you're right. Updated .NuGet Xamarin Essentials to v1.6.0.pre2 and now they show and work properly. Thanks very much!! PS: Preliminar packages features can be embedded in final deployed release binaries? PS2: Found myself the site with this info (it's not shown in official Xamarin.Essentials API reference): docs.microsoft.com/es-es/xamarin/essentials/release-notes/1.6Bull

1 Answers

3
votes

AS Jason commented, both classes are introduced in Essential 1.6, which is in pre-release state as of nowadays.

The Xamarin.Essentials needed version is not show in official API docs (https://docs.microsoft.com/en-us/xamarin/essentials/ but it does so here:

https://docs.microsoft.com/es-es/xamarin/essentials/release-notes/1.6

Thanks Jason, for the concise and quick answer!