Is the Forms PCL Dying?

alaskanroguealaskanrogue USMember ✭✭✭

I was just told on a ASP.NET forum that the PCL is coming to end of its life. What's taking its place in cross-platform development?

Best Answers

Answers

  • alaskanroguealaskanrogue USMember ✭✭✭

    Are you saying that a common library is disappearing?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    No, you will have a net standard library
  • alaskanroguealaskanrogue USMember ✭✭✭

    So, are you saying that I would have to maintain different common code across the platforms using .NET Standard in each or just create a library meeting the standard?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    You should explain what you have to do. When you create an XF project you should have two options: shared project or net standard
  • alaskanroguealaskanrogue USMember ✭✭✭

    I have an existing shared project which has evolve with Xamarin over the past 6 years. I don't want to rebuild it at this time or in the near future. Hence my question.

  • alaskanroguealaskanrogue USMember ✭✭✭

    @NMackay Noted. It's a timing issue, not a code evolution issue.

  • alaskanroguealaskanrogue USMember ✭✭✭
    edited September 5

    Beyond everyone thoughts, but per the link that @AdamMeaney provided, .NET Standard is not a replacement for a PCL, but part of the framework that it should be built on (that's what I thought and have been using in my PCL):

    .NET Standard versioning is important for usage. Given a .NET Standard version, you can use libraries that target that same or lower version. The following approach describes the workflow for using .NET Standard PCLs, specific to .NET Standard targeting.

    Select a .NET Standard version to use for your PCL. Use libraries that depend on the same .NET Standard version or lower.

  • AdamMeaneyAdamMeaney USMember ✭✭✭✭✭

    The .NetStandard libraries are the previously called PCL libraries. Its just a different format basically, the transition is simple.

  • JohnHardmanJohnHardman GBUniversity mod

    @AdamMeaney said:
    The .NetStandard libraries are the previously called PCL libraries. Its just a different format basically, the transition is simple.

    Simple, but don't believe the 5 minutes claimed in at least one Xamarin video.

  • XavierPerseguersXavierPerseguers CHMember ✭✭✭

    It's true that it's basically just a different format. But indeed, I needed much more than 5 minutes because of lots of problems do be able to compile again afterwards as sometimes Xamarin/VS are just not willing to do some big updates easily.

    Don't know if there's a wizard now, but if not, and if you don't know how to start, here's a simple way to do that, a bit dumb but not that much after all:

    • Create a new solution, named it the same as the one you want to migrate
    • Copy over everything that is device specific (iOS/Android code)
    • For every other project that is PCL, create a .NETStandard project with the same name and copy over the files, not the project itself, add again missing dependencies from the UI
    • You may want to diff old/new afterwards to ensure you did not forget something important

    and voilà! you have a clean migrated solution. You may possibly migrate only PCL project like that, see what changed and do the same manually/automating the migration of the other PCL projects.

    HTH

Sign In or Register to comment.