Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms InitializeComponent does not exist

I am learning Xamarin Forms for Visual Studio 2015 and trying to create a simple Shared project using Xaml but I keep getting InitializeComponent does not exist (as well as any reference to Xaml controls in cs classes).

It is my understanding that in the latest versions of Xamarin, Xaml works in Shared Xamarin Forms Projects (and not only in PCL projects). I've tried running the latest betas that got released less than a month ago but still no luck.

Any advice is greatly appreciated.

like image 558
Vesselin Obreshkov Avatar asked Apr 15 '16 16:04

Vesselin Obreshkov


1 Answers

Turns out I had to manually change the properties for all Xaml files like so:

Build Action: Embedded resource
Custom Tool: MSBuild:UpdateDesignTimeXaml

For some reason adding new Xaml forms files doesn't set these by default in VS2015 with latest Xamarin.

like image 65
Vesselin Obreshkov Avatar answered Sep 22 '22 06:09

Vesselin Obreshkov