dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.05k stars 4.69k forks source link

Package System.Numerics.Vectors 4.5.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). #40253

Open Jaycecoding opened 4 years ago

Jaycecoding commented 4 years ago

Hi there,

I'm very new to programming and my class has started with a basic Xamarin project using Visual Studios 2019, however whenever I try to run the program using the android emulator I get this error message: Package System.Numerics.Vectors 4.5.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0).

All that I'm trying to run is a blank template using the Xamarin.Forms project template. It should display a basic message through the android emulator, but I can't get to that part.

I've tried to check/uncheck the build in the solution properties, but it doesn't seem to fix the issue. Any idea of what is causing this messsage?

ghost commented 4 years ago

Tagging subscribers to this area: @tannergooding, @pgovind See info in area-owners.md if you want to be subscribed.

DickBaker commented 4 years ago

Yes, "System.Numerics.Vectors 4.5.0 is not compatible with netstandard2.0" and your error likely says Error NU1202 Package System.Numerics.Vectors 4.5.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package System.Numerics.Vectors 4.5.0 supports:

In my solution it was due to system.text.json needing dependency to System.Numerics.Vectors and resolving that from netstandard2.0 TargetFramework (that contains v4.5.0 despite being incompatible!).

Suggest you add an explicit dependency like this to your .csproj file (anglebrackets removed due to MD) PackageReference Include="System.Numerics.Vectors" Version="4.6.0-preview4.19212.13" / so loader will resolve there instead (and compatible with netstandard2.x).

System.Numerics.Vectors 4.5.0 dates from May 2018 (long before our current versions) so lack basic unit/integration tests. Eventually MS will get it right, but they should issue a health/wealth warning meantime !

Jaycecoding commented 4 years ago

Yes, "System.Numerics.Vectors 4.5.0 is not compatible with netstandard2.0" and your error likely says Error NU1202 Package System.Numerics.Vectors 4.5.0 is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Package System.Numerics.Vectors 4.5.0 supports:

  • monoandroid10 (MonoAndroid,Version=v1.0)
  • monotouch10 (MonoTouch,Version=v1.0)
  • netcoreapp2.0 (.NETCoreApp,Version=v2.0)
  • uap10.0.16299 (UAP,Version=v10.0.16299)
  • xamarinios10 (Xamarin.iOS,Version=v1.0)
  • xamarinmac20 (Xamarin.Mac,Version=v2.0)
  • xamarintvos10 (Xamarin.TVOS,Version=v1.0)
  • xamarinwatchos10 (Xamarin.WatchOS,Version=v1.0)

In my solution it was due to system.text.json needing dependency to System.Numerics.Vectors and resolving that from netstandard2.0 TargetFramework (that contains v4.5.0 despite being incompatible!).

Suggest you add an explicit dependency like this to your .csproj file (anglebrackets removed due to MD) PackageReference Include="System.Numerics.Vectors" Version="4.6.0-preview4.19212.13" / so loader will resolve there instead (and compatible with netstandard2.x).

System.Numerics.Vectors 4.5.0 dates from May 2018 (long before our current versions) so lack basic unit/integration tests. Eventually MS will get it right, but they should issue a health/wealth warning meantime !

Thanks for the reply Dick. Where would the angle brackets be placed? And I can't seem to find the csproj file to edit in my 2019 VS..

DickBaker commented 4 years ago

see att screenshot as example from an Issue and PR I was working on for https://github.com/PacktPublishing/C-8-and-.NET-Core-3-Projects-Using-Azure-Second-Edition Jaycecoding

In VS2019 you can just click on the project name to display the .csproj (no need to unload and poke about)

tannergooding commented 4 years ago

This looks to be the same issue as https://github.com/dotnet/runtime/issues/39925#issuecomment-664622513, and a binding redirect is missing. CC. @ericstj