Issue
I just downloaded Visual Studio and created a new Xamarin.Forms project. However, when building the app with the auto-generated code I got stuck on the following error in the code-behind of MainPage.xaml:
The name 'InitializeComponent' does not exist in the current context
I looked up solutions on the internet but did not find one that works for me. What I tried:
Changing the custom tool in the properties of MainPage.xaml (which was empty beforehand)
I checked if the namespaces match (they do)
I tried saving all the files
Here is an image of the auto-generated code, which I didn't edit:
Solution
I've had this issue crop up here and there where InitializeComponent
and a number of other classes and methods "does not exist in the current context". Not sure of the underlying problem, but if it is the same as I've had, I unload and reload all projects. This can be accomplished by right clicking on the project in the solution explorer, clicking unload, right clicking again, and hitting reload.
Answered By - Timothy James
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.