Microsoft.Maui.Essentials on Xamarin.Android and Xamarin.iOS apps

fdhsdrdark 61 Reputation points
2022-09-23T11:44:36.007+00:00

I have started to port my existing Xamarin.Android and Xamarin.iOS applications to .Net Android and .Net iOS.
According to this post https://devblogs.microsoft.com/xamarin/xamarin-essentials-1-7-and-introducing-net-maui-essentials/#comment-1040
by adding the <UsingMauiEssentials>true</UsingMauiEssentials> on the csproj file I should be able to write sth like 'using Microsoft.Maui.Media;'
without any issues. However, even by changing the csproj file, I am not able to so.
Kindly note that I have created a brand new .Net Android app from Visual Studio 2022 template and that on the .Net MAUI template works just fine.

I am using Visual Studio Version 17.3.4.

Thanks very much.

p.s: That's the csproj file I am using
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-android</TargetFramework>
<SupportedOSPlatformVersion>28.0</SupportedOSPlatformVersion>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationId>com.companyname.Integrated.TestApp.Android</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<UsingMauiEssentials>true</UsingMauiEssentials>
</PropertyGroup>
</Project>

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. fdhsdrdark 61 Reputation points
    2022-09-23T14:57:43.643+00:00

    For anyone landing here and want to use latest Xamarin Essentials on their project just use the tag 'UseMauiEssentials' not 'UsingMauiEssentials'

    <UseMauiEssentials>true</UseMauiEssentials>

    3 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.