Migration from PCL to .Net Standard throws errors for XAML pages

Hi,

When migrating a Xamarin Forms PCL project to .Net Standard 2.0 I am experiencing this error for certain XAML pages.

Error Value cannot be null.
Parameter name: type Line 1.

How the migration is done.

Created a new project in VS 2017 15.5.7 targetting Xamarin Forms and .Net Standard 2.0

Added all the Nuget packages related to my project.

Added the existing XAML pages and .cs files from the old project that was developed in Visual Studio for Mac.

When building the project the error is thrown for certain forms. The rest of the forms are fine.

What is the reason for this error and how to fix this. I even tried creating a basic Content Page in the same project and this file is also affected by this error. But when creating a new project and starting with a single XAML page it does not throw this error.

Has anyone come across this error.

Thanks,

Rajesh.

Answers

  • coolrjmcoolrjm INMember ✭✭✭

    Hi,

    I fixed the issue when I found that those particular XAML pages had a custom control build in an older version of Xamarin Forms.

    Upgrading the version of Xamarin for the custom control fixed the issue. Now all the pages are rendered properly in .Net Standard 2.0

    Hope that this will help anyone who faces this issue when migrating.

    Regards,

    Rajesh.

Sign In or Register to comment.