• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Cant integrate Model project between AspNetWebApi and XamarinForms with nothing above ".Net Standard

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
* This one tell you should move to .net 5 : https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/  
* This one tell you to stay with ".Net Standard 2.0" : https://stackoverflow.com/a/66315929  
* This one tell you to go with .Net 6 : https://docs.microsoft.com/en-us/ef/core/miscellaneous/platforms  

Im getting crazy because I want reuse my Models class on my WebApi and on my Xamarin Forms projects but Xamarin dont allow reference nothing above 2.0.  
Im going to rewrite EVERYTHING and cant decide what version framework to use.  
Would be great use the latest EF Core version on process.  
I tried MAUI and it isn't mature, made me yet more crazy.

Thanks for any help.  
Almost jumping from a bridge here.  

 
Marshal
Posts: 79953
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to our .NET forum.
 
Campbell Ritchie
Marshal
Posts: 79953
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The SO thread says Xamarin users should stay on .NET 2 until .NET 6 is available.
The devblog link says .NET 5 is available.
I haven't read the three threads properly, but the third seems to suggest .NET 6 isn't fully available yet.
Please note the dates on the three posts, and regard the newer as superseding the older. One is 15‑Sep‑2020, one is 22‑Feb‑2021 and one is 18‑Dec‑2021.
 
Saloon Keeper
Posts: 15727
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All links you posted are in agreement, they don't contradict each other.

The first link tells you that for application components (not reusable libraries) you should use the lowest version number of the platform you're targeting. For an old Xamarin application, this is .NET Core 2.0.

The second link tells you to use .NET Core 2.0 for an old Xamarin application, and .NET 6 for a new Xamarin application.

The third link tells you to use .NET 6.0 if you're using EF Core 6.0. It doesn't say what version to use for what Xamarin version, but it does mention that there are known issues with Xamarin applications.

So really, it all boils down to this:
  • First choose a Xamarin version that you want your application to use.
  • Target the .NET version that is supported by your chosen Xamarin version.
  • Use the highest EF Core version that targets your .NET version.

  • The reason you can't upgrade your .NET version in your existing application is probably because you're using an older Xamarin version.

    Try to create a completely new application that uses the latest Xamarin version with .NET 6, and see if it works. Then add the correct EF Core version.
     
    Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic