且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

InitializeComponent不存在

更新时间:2022-10-15 12:07:17

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

如果这样不起作用. 更新您的块包,以便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.