Why Xamarin.Forms provide support for .NET Standard 1 & .NET Standard 2

sheiksyedsheiksyed Member ✭✭

I have custom control which using .NET Standard 1.0. Recently faced the Xaml previewer issue in VS2019 and to make the control visible in the designer, need to set [DesignTimeVisible (true)] attribute for control. But, DesignTimeVisible attribute is not available in .NET Standard 1.0 and have plans to move control to .NET Standard 2.0. Also, I have doubts why Xamarin.Forms provide support for both .NET Standard 1 & 2 rather than .NET Standard 2? If I move my control to .NET Standard 2.0 whether I will face any compatibility issue?

Answers

  • JoeMankeJoeManke USMember ✭✭✭✭✭

    I believe the dual .NET Standard 1.0 and 2.0 support is accomplished by compiling the code twice. Your project will only consume one set of DLLs or the other depending on your target framework. There shouldn't be any compatibility issues as .NET Standard 2.0 projects are backwards-compatible with .NET Standard 1.0 packages.

  • sheiksyedmsheiksyedm Member
    edited April 20

    @StephaneDelcroix  @SamanthaHouts @DavidOrtinau @JamesMontemagno     Could I please know is there any specify reason for targeting Xamarin.Forms to both .NET Standard 1 & 2.0. I have cross checked @JamesMontemagno’s “ImageCirclePlugin” project where it targets only .NET Standard 2.0 alone, whereas Xamarin.Forms project targeting both .NET Standard version. Could you please let me know is it Ok to set .NET Standard 2.0 alone for my custom control as minimum version? Will I be losing anything If I do so?

  • JoeMankeJoeManke USMember ✭✭✭✭✭

    You will be absolutely fine targeting .NET Standard 2.0.

Sign In or Register to comment.