We are developing Shared Code based Xamarin Forms app to be deployed across Android and iOS platforms. We are facing this strange issue number of times. There is compile time error on InitializeComponent which didn't let code to compile. We have gone through almost all the stackoverflow questions and xamarin discussions on this topic. None to them helped.
Following is code-
DocumentSearchPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace FinderApp.Views
{
public partial class DocumentSearchPage : ContentPage
{
public DocumentSearchPage ()
{
InitializeComponent ();- This line show compilation issue- InitializeComponent doesn't exist in current context
}
}
}
DocumentSearchPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="FinderApp.Views.DocumentSearchPage">
<ContentPage.Content>
</ContentPage.Content>
</ContentPage>
Till now we have tried-
- Changing property custom tool to different values
- Checking if Namespace names are matching in xaml and cs file
- Updated xaml forms to v2.3.0.38 pre2. Obiviously we have tried with stable version first.
- Clean Rebuild solution
Enviroment
iMac OS X 10.11.2 Xamarin Studio 5.10.3 Xamarin Forms 2.3.038 pre2
We are facing issue on windows8, visual studio 2015 also.\ We have this issue with PCL approach too.
Expert help needed!