Reputation: 21
After creating every single Cross Platform project in Visual Studio 2017 Preview 15.6.0 v1.1, I'm getting error from the picture, actually 2 errors.
The name 'InitializeComponent' does not exist in the current context
The second error is related to NuGet Package Manager, I can't update any of packages, error message:
Package restore failed. Rolling back package changes for 'testApplication.Android'.
Upvotes: 1
Views: 915
Reputation: 611
One of two reason.
Your x:Class
doesn't match up with the MainPage.xaml
namespace. Male sure they match
Or "Build Action" is not set to "Page" for MainPage.xaml
Upvotes: 0
Reputation: 81573
Failing some actual code error, i would try the following
In regards to
The name 'InitializeComponent' does not exist in the current context
Steps that worked for me
Package restore failed
Try updating all packages for solution in the package package console
Update-Package –reinstall
In regards to your comments when trying Update-Package -reinstall
Update-Package : Package Xamarin.Android.Support.Design 26.1.0.1 is not compatible with monoandroid71 (MonoAndroid,Version=v7.1). Package Xamarin.Android.Support.Design 26.1.0.1 supports: monoandroid80 (MonoAndroid,Version=v8.0)
Also Check you are using the appropriate version of the Andriod Sdk
Tools > Andriod > Andriod Sdk Manager
Upvotes: 2