Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

UWP Can't load types from xmlns http://schemas.microsoft.com/winfx/2006/xaml/presentation

NaYouNaYou MAMember

Hello,

I created a new Shared Xamarin.Forms project in Visual Studio 2015.
When I build the solution (without making any change), I receive this error : "Can't load types from xmlns http://schemas.microsoft.com/winfx/2006/xaml/presentation" in the "app.xaml" file of the UWP project.

Do you have any idea about this error and how to solve it ?

Thank you and BR.

Answers

  • HunumanHunuman GBMember ✭✭✭✭
    edited June 2017

    Hi @NaYou

    I think the namespace declaration may be incorrect.

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml/presentation" is specific to WPF not Xamarin.Forms AFAIK.
    Though if it is in the UWP platform project, it may be correct.

    Hope this points you in the right direction.

    Tim

  • NaYouNaYou MAMember

    Hi @Hunuman,
    Thank you for your answer.

    About the namespace, Microsoft say that this is the same XAML namespace identifier used in several predecessor Microsoft technologies that also use XAML as a UI definition markup format. So I think it includes Xamarin.
    The second point, is that I didn't modify the namespace. It comes with the defaut UWP Xamarin project.

  • DanielVidalesDanielVidales USMember ✭✭
    edited July 2018

    Hi @Hunuman, I was dealing with the same problem, had it solved by defining the Build Action for the corresponding XAML as Page. So select the XAML on the UWP project, Alt+Enter to bring the File Properties and set the Build Action as Page. The XAML resources on the shared project are the ones defined as Embedded Resourced in order for Xamarin to do its magic as they are ContentPage instances, which will be mapped to a UWP Page instance anyway, so you can directly use Page on the UWP project. Hope this is clear. Best. By the way, you might also want to verify that App.xaml Build Action is defined as ApplicationDefinition. @NaYou

Sign In or Register to comment.