Xamarin.Forms - InitializeComponent doesn't exist when creating a new page

前端 未结 30 2355
不知归路
不知归路 2021-01-30 12:36

I\'m using Visual Studio to try out Xamarin.Forms. I\'m trying to follow the guide: http://developer.xamarin.com/guides/cross-platform/xamarin-forms/xaml-for-xamarin-forms/getti

30条回答
  •  暖寄归人
    2021-01-30 12:47

    UPDATE: This error doesn't usually appear in VS 2015, if it does, here's my original answer:

    Found the solution! Right click on the .XAML file, select Properties.

    You will see a Property called Custom Tool. Change its value from MSBuild:Compile to MSBuild:UpdateDesignTimeXaml

    This will solve the problem. Dont know about the downvote, but here's my screenshot:

    UPDATE:

    It reappears rarely. If it does, just open the Xaml and code behind files and save them. I know, its not the best solution, but it gets the job done.

提交回复
热议问题