none
Xamarin Forms Project Xaml compilation error in VS15 Community with Update 2 installed

    Question

  • I am having the following error when compiling Xamarin Forms PCL project after adding a Xaml Page.

    <path>\MainPage.xaml.cs(15,13,15,32): error CS0103: The name 'InitializeComponent' does not exist in the current context

    The same error is encountered when compiling some of their sample projects.

    After searching this error in Xamarin community, people mentioned about saving the file again or changing the custom tool, nothing has helped so far really.

    Can you please advise?

    • Moved by Jamles Hez Friday, April 8, 2016 7:08 AM
    Thursday, April 7, 2016 9:23 AM

Answers

  • Hi, the problem is solved. Only the following step helped me to get rid of Initializecomponent missing error. In package manager console, issue the following command:

    update-package -project your_pcl_project_name -reinstall

    The build is successful thereafter but the intellisense error still exists. But I can live with that for the time being.
    • Marked as answer by Monto2k2 Saturday, April 9, 2016 5:37 PM
    Saturday, April 9, 2016 5:37 PM

All replies

  • Hi Monto2k2,

    >> The same error is encountered when compiling some of their sample projects.

    This forum is about the usage of MSBuild, build customization, and MSBuild extensibility via tasks, loggers and hosting, as your issue is more related to the Visual Studio itself, we help you move it to the Visual Studio General Questions forum for better support.

    Thank you for your understanding.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, April 8, 2016 7:06 AM
  • Hi, the problem is solved. Only the following step helped me to get rid of Initializecomponent missing error. In package manager console, issue the following command:

    update-package -project your_pcl_project_name -reinstall

    The build is successful thereafter but the intellisense error still exists. But I can live with that for the time being.
    • Marked as answer by Monto2k2 Saturday, April 9, 2016 5:37 PM
    Saturday, April 9, 2016 5:37 PM