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

前端 未结 30 2349
不知归路
不知归路 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:56

    I came across this error when;

    1. I removed a ContentPage-cs+xaml and the App-cs+xaml from the project without actually deleting it.
    2. Re-added these to the project in another folder.

    This was fixed by;

    1. Select the .xaml file of the class in which the issue is present.
    2. Right click and select properties.
    3. In Build action select "Embedded Resource"
    4. In Custom Tool type "MSBuild:UpdateDesignTimeXaml"
    5. Clean and Build and it was gone.

提交回复
热议问题