【问题标题】:Page does not exist build error in xamarinxamarin 中的页面不存在构建错误
【发布时间】:2017-02-10 06:55:02
【问题描述】:

我已经使用 Xamarin 重新安装了 VS2015 社区。我在可移植项目中创建了一个 xaml 页面。然后我看到了人们一直在讥讽的最常见的错误,InitializeComponent does not exist in the current context。人们提出了很多解决方案。

最后,将我的 Hellopage.cs 的 build 属性更改为 Embedded 资源。但是,一旦在您设置 Mainpage 的 App.cs 中完成此操作,我会看到红色波浪线表示我的 Hellopage 不存在? 这就是我尝试设置主页的方式。

MainPage = new Hellopage();

我错过了什么?

Worked Solution Link

【问题讨论】:

    标签: c# xamarin cross-platform


    【解决方案1】:

    我之前遇到过这个问题,原因是 XAML 文件没有被正确处理。你应该尝试的是:

    1. 在 Hellopage.xaml 的属性窗格中,查看自定义工具
    2. 将值更改为 MSBuild:Compile 或其他内容
    3. 单击以确保 Visual Studio 处理更改
    4. 将值改回 MSBuild:UpdateDesignTimeXaml

    您可以尝试的另一件事是打开 xaml 和 xaml.cs 文件并保存它们。

    【讨论】:

    • 这就是修复它的原因。当我读到这篇文章时,我不敢相信你没有一个 UpVote。现在你有我的了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-03-31
    • 1970-01-01
    • 2017-12-05
    • 2011-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多