Strange warning when loading Xamarin.Forms project. How to get rid of it.

jstuardojstuardo Member ✭✭
edited July 15 in Xamarin.Forms

Hello,

When opening a project, these warnings are shown in the error list window in Visual Studio 2019:

El paquete "Plugin.MediaManager 0.4.5" se restauró con ".NETFramework,Version=v4.6.1" en lugar de la plataforma de destino del proyecto ".NETStandard,Version=v2.0". Puede que el paquete no sea totalmente compatible con el proyecto.

El paquete "Plugin.MediaManager.Forms 0.4.5" se restauró con ".NETFramework,Version=v4.6.1" en lugar de la plataforma de destino del proyecto ".NETStandard,Version=v2.0". Puede que el paquete no sea totalmente compatible con el proyecto.

Translation:

The "Plugin.MediaManager 0.4.5" package was restored with ".NETFramework, Version = v4.6.1" instead of the project target platform ".NETStandard, Version = v2.0". The package may not be fully compatible with the project.

The package "Plugin.MediaManager.Forms 0.4.5" was restored with ".NETFramework, Version = v4.6.1" instead of the target platform of the project ".NETStandard, Version = v2.0". The package may not be fully compatible with the project.

This is the csproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <ProduceAssemblyReference>true</ProduceAssemblyReference>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DebugType>pdbonly</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Plugin.MediaManager" Version="0.4.5" />
    <PackageReference Include="Plugin.MediaManager.Forms" Version="0.4.5" />
    <PackageReference Include="Xamarin.Forms" Version="4.1.0.555618" />  
    <PackageReference Include="Xamarin.Essentials" Version="1.1.0" />  
    <PackageReference Include="ZXing.Net.Mobile" Version="2.3.2" />  
    <PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.3.2" />
  </ItemGroup>
</Project>

Xamarin projects allow only .NET version up to 2.0, so I have no idea why those warnings are shown.

Regards
Jaime

Answers

  • DirkWilhelmDirkWilhelm USMember ✭✭✭✭

    As the error message shows, the Plugin.MediaManager and Plugin.MediaManager.Forms nugets use NETFramework Version v4.6.1 as target framework. Normally that should be no problem.

    As far as i can see, that plugin added netstandard2.0 support in version 0.5.0, so try updating those nugets (current version is 07.2.)

  • jstuardojstuardo Member ✭✭

    It is clear, but how is it possible that MediaManager uses version 4.6.1 when the project version only can be set up to version 2?

    I have installed last version at first and the same warning was shown. I have to use a previous version because last version did not work cause of a compile time error I don't remember now. Plugin documentation is very poor and I have only found samples using the version I installed.

  • DirkWilhelmDirkWilhelm USMember ✭✭✭✭

    @jstuardo said:
    It is clear, but how is it possible that MediaManager uses version 4.6.1 when the project version only can be set up to version 2?

    It is possible because the MediManager targets .Net Framework 4.6.1 and you project targets .Net Standard 2.0.
    Thats two different things. There is no .NetStandard 4.6.1.

    Read this to get more information on .Net Standard: https://docs.microsoft.com/en-us/dotnet/standard/net-standard

Sign In or Register to comment.