0

When trying to install Azure.Storage.Files.Shares on a empty .NET MAUI app (created directly from the VS 2022 17.4.4 wizard) I get a series off incompatibilities. If have tried a simple Console app and the problem is the same.

  • Restoring packages for C:\Users\brend\source\repos\MauiApp7\MauiApp7\MauiApp7.csproj...
  • NU1202: Package Azure.Storage.Files.Shares 12.12.1 is not compatible with net7.0-android33.0 (.NETCoreApp,Version=v7.0). Package Azure.Storage.Files.Shares 12.12.1 does not support any target frameworks.
  • NU1202: Package Azure.Storage.Common 12.13.0 is not compatible with net7.0-android33.0 (.NETCoreApp,Version=v7.0). Package Azure.Storage.Common 12.13.0 does not support any target frameworks.
  • NU1202: Package System.Text.Json 4.7.2 is not compatible with net7.0-android33.0 (.NETCoreApp,Version=v7.0). Package System.Text.Json 4.7.2 does not support any target frameworks.
  • NU

Any ideas what I am missing?

I expected the Nuget package to install, just like the demos in the Microsoft examples

  • Instead of `net7.0-android33`, the MAUI project should probably only target `net7.0-android`. Try changing that in the .csproj file of your MAUI app. – Julian Jan 29 '23 at 08:57
  • Can you tell us which microsoft examples are you trying? or have you tried restarting or cleaning the project? – Kartoos Jan 29 '23 at 10:09

2 Answers2

0

I don't think the package Azure.Storage.Files.Shares is available for MAUI.

You can check the dependencies section of the nuget package here. The only target it supports is .NETStandard 2.0

[.NETStandard 2.0]
Azure.Storage.Common (>= 12.13.0)
System.Text.Json (>= 4.7.2)

Compare it with, for example the package which supports MAUI like ZXing library which has the required target .net7.0-android33.0

[net7.0-android33.0]
Xamarin.AndroidX.Camera.Camera2 (>= 1.1.0)
Xamarin.AndroidX.Camera.Lifecycle (>= 1.1.0)
Xamarin.AndroidX.Camera.View (>= 1.1.0)
ZXing.Net (>= 0.16.8)

Edit

As @ewerspej pointed out, the library indeed has net7.0-android target if we look in framwework section on nuget package site. I tested out by creating new MAUI project with net7.0-android as target framework and also by changing to specific net7.0-android33.0 as well in .csproj file, I was able to install the package correctly in both the cases!

Kartoos
  • 737
  • 1
  • 8
  • 24
  • .NET 7.0 is listed under Frameworks. Generally .NET Standard 2.0 is supported by .NET 7.0. I think the problem is the specific target, instead of `net7.0-android33`, the MAUI project should only target `net7.0-android`. – Julian Jan 29 '23 at 08:56
0

I did discover that the Nuget cache must have been corrupted in some way. I did try to clear the cache using the tools in VS 2022, however an error occurred. After reinstalling Visual Studio I was able to use the Azure.Storage.Files.Shares package.

As pointed out in one of replies net7.0-android and net7.0-android33.0 had something to do with the problem, but I was not able to isolate it.