Snack Pack 15: Upgrading to Xamarin.Forms to .NET Standard

Sign in to queue

Description

Welcome to The Xamarin Show Snack Pack Edition. A Snack Pack is bite sized episode that is focused on a specific topic and covered in just a few minutes. Today, we take a look at how to manage and upgrade your Xamarin and Xamarin.Forms based applications to target .NET Standard. We also see how to install existing PCL based NuGets into that library.

Show Links:

Embed

Download

Download this episode

The Discussion

  • User profile image
    gradyjenkins

    James, is there going to be support for WCF in a .Net Standard eventually? Right now I'm not able to add any services and it's causing quite a roadblock. 

  • User profile image
    EricBrunner

    Well done. What I missed is the removal of the PCL reference from the xplat projects and adding of the reference to the newly created .NET Standard library. I guess starters would maybe struggle with getting up and running....

  • User profile image
    TamarinCode​Monkey

    Is there any way to create a cross-platform project like this where it doesn't show up as (Portable)?  All of the cross platform options seem to either PCL or shared, not .Net Standard.

    Are you guys going away from PCL/Shared or are there going to be new options in the future that might implement this as a default instead of having to add or switch the type of project you started with?

  • User profile image
    James​Montemagno

    @TamarinCodeMonkey: We are working on new project templates that will replace PCL with .NET Standard in a future release. The current flow is to upgrade via the flow I showed here. It is pretty simple to do, but will be default in the future.

  • User profile image
    James​Montemagno

    @gradyjenkins: WCF isn't part of core .NET itself and is a separate library so it wont ever be added to the core .NET standard API from my understanding. You may want to look into shared project for your apps.

  • User profile image
    Dirk

    @James​Montemagno you showed the new .csproj format for the new .netstandard class library. Can the platform specific projects also use this new format?

  • User profile image
    TamarinCode​Monkey

    @JamesMontemagno: Thanks for the info!

    Trying to keep up with what is going to be the next thing with the most support seems to be a pain with a so far, ever changing platform like Xamarin.  Having all the options is good but I always want to know what is going to be the easiest to use with the most support for the coming years.

  • User profile image
    Mans Tanneryd

    Can't get this to work. If does not build complaining about missing method InitializeComponent() in MainPage.xaml.cs.

    Oh, also. It would be nice if I could actually write my swedish name correctly in the name input field in this form. Only allowing a-z letters in names. Really? :-)

  • User profile image
    mkkkk

    Mmmm. I think you people over at Xamarin need to take a step back because you are over complicating things now. No clue how this new stuff benefits me

  • User profile image
    Don

    @JamesMontemagno: Please see this: https://forums.xamarin.com/discussion/100129/xamarin-forms-vs2017-netstandard-xaml-and-code-behind-are-not-grouped#latest

  • User profile image
    weitzhandler

    @James​Montemagno

    I was unable to use the package System.ComponentModel.Annotations. Looks like this package works in PCL, but it doesn't work for the NetStandard. Any ideas?

    Did you select 4.5.2 on purpose?

  • User profile image
    arieldeloss​antos

    @JamesMontemagno:doing this migration into a more complex project, is giving me few errors, one of them is that is duplicating the .xaml pages and cs... all the .xaml files generates a .cs multiple times... i am working with VS for mac.

  • User profile image
    Nuri

    Please spend 1 minutes more and "compile" your project. Did you try?

  • User profile image
    ak99372

    You know you're doing something wrong when you need to install package in order to install another package, on top of which you need force VS with "I know what I'm doing"... all of this to achieve this illusion of "awesome" compatibility.

  • User profile image
    James Ison

    Where are the project template for apps with .NETStandard??? what's the point of releasing it without any tools to convert projects or create new ones?

    It's causing massive issues with an already brittle toolset.

  • User profile image
    amjadhussei​ni

    Hi,

    What's the added value that I get when using .Net standard library over PCL? i know this might be a generic question but it's good to make it clear for all of us.

  • User profile image
    Dan Meier

    @JamesMontemagno, Any update on the timing of Visual Studio project templates for .NET Standard libraries in Xamarin cross-platform projects? Seems as if the instructions in your video aren't accurate just four months down the road with .NET Standard 2.0 and VS 15.4.4. Spent a week troubleshooting and working out a new (and NOT simple) procedure to get everything working. The project templates would be MOST helpful!!!

Add Your 2 Cents