InitializeComponent不存在 [英] InitializeComponent does not exist

查看:221
本文介绍了InitializeComponent不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

InitializeComponent();

此代码行出现在我所有Xaml页面的构造函数中,位于后面的代码中. 它将引发以下错误:

InitializeComponent不存在.

尽管我已经注释掉了这一行,但是现在我无法调试项目中的任何页面.

我该如何解决?

任何帮助将不胜感激.

注意:我正在使用Xamarin Forms Portable项目.

更新:当我注释掉这一行并运行页面时,尽管我的页面之前运行正常且没有错误,但在IOS和Android中都只显示了一个空白屏幕.

更新2:,现在InitializeComponent行消失了,但是我调试的页面仍然完全空白.

我已经在此处询问了有关此新问题的问题.

解决方案

更改页面中的内容,然后保存.可以很好地解决此问题.

如果这样不起作用. 更新您的块包,以便Xam Forms是最新的. 清理"您的项目 转到项目目录,然后通过文件资源管理器从项目中删除bin和obj.

重建它.

祝你好运.

InitializeComponent();

This code line appeared in all my Xaml pages' constructors in code behind. It throws the following error:

InitializeComponent does not exist.

Now I cannot debug any page in my project although I have commented out this line.

How can I fix this?

Any help would be greatly appreciated.

Note: I'm using Xamarin Forms Portable project.

Update: When I comment out this line and run the pages, only an empty screen shows up in both IOS and Android although my pages were working correctly without error before.

Update 2: now the InitializeComponent lines are disappeared but the pages that I debug are still totally blank.

I have asked a question about this new problem on here.

解决方案

Change something in the page, then save it. Scarily this resolves the issue sometime.

If that doesn't work. Update your nugget packages so Xam Forms is the latest. "Clean" your project Go to your project dir and delete the bin and obj from your projects via File Explorer.

Rebuild it.

Good luck.

这篇关于InitializeComponent不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆