Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin.forms InitializeComponent未在当前上下文中定义-Xamarin表单_Xamarin.forms - Fatal编程技术网

Xamarin.forms InitializeComponent未在当前上下文中定义-Xamarin表单

Xamarin.forms InitializeComponent未在当前上下文中定义-Xamarin表单,xamarin.forms,Xamarin.forms,我们正在开发基于共享代码的Xamarin表单应用程序,以跨Android和iOS平台部署。我们多次面临这个奇怪的问题。InitializeComponent上存在编译时错误,不允许编译代码。我们已经讨论了几乎所有关于这个话题的问题和xamarin的讨论。没有人对他们有帮助 下面是代码- DocumentSearchPage.xaml.cs using System; using System.Collections.Generic; using System.Linq; using System

我们正在开发基于共享代码的Xamarin表单应用程序,以跨Android和iOS平台部署。我们多次面临这个奇怪的问题。InitializeComponent上存在编译时错误,不允许编译代码。我们已经讨论了几乎所有关于这个话题的问题和xamarin的讨论。没有人对他们有帮助

下面是代码-

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>

到目前为止,我们一直在努力-

  • 将特性自定义工具更改为不同的值
  • 检查xaml和cs文件中的命名空间名称是否匹配
  • 将xaml表单更新到v2.3.0.38 pre2。显然,我们已经尝试了稳定的版本第一
  • 清洁重建解决方案
  • 环境

    iMac OS X 10.11.2 Xamarin工作室5.10.3 Xamarin表格2.3.038 pre2

    我们也面临windows8和visual studio 2015的问题\ 我们也有PCL方法的问题


    需要专家的帮助

    如果您使用的是VS 2015,似乎很幼稚,但这是目前的状态,没有理由解释,但截至2016年8月和最新的xamarin,这是状态

  • 封闭再灌注液
  • 清洁溶液
  • 重建解决方案

  • 据我所知,这个错误应该得到解决。旧的错误修正是:更改XAML中的某些内容并将其更改回原处。我在Mac中的Xamarin Studio也存在巨大问题,强制完全、开放、干净、重建。许多人在这里回答了这个问题: