Nuget update to XForms causes error indication for Xaml properties in code behind file.

I've just updated my Xamarin Forms to the latest stable release ( from Now whenever I open a code behind file I get error indications on all variables etc. that reference something in my Xaml.
InitializeComponent - apparently does not exist in the current context.
'PageName' does not contain a definition for 'mainGrid' and no extension method 'mainGrid' accepting a first argument of type 'PageName' could be found (are you missing a using directive or an assembly reference?)

If I ignore all these error messages then it all actually compiles and runs fine. But the error indications are incredibly annoying.

I've gone through the following process to no avail:
1. Clean solution in VisualStudio
2. Close VisualStudio
3. Delete all "bin" and "obj" Folders (from the whole solution) manually
4. Delete "packages" Folder manually
5. Restart VisualStudio
6. Rebuild all

I reverted this project back to XamarinForms but the Errors are still being indicated.

Creating a new blank project also tells me there are errors, but again compiles and runs fine - the blank project loads version

Any ideas to get the compiler to stop indicating errors that aren't there?

Best Answer


Sign In or Register to comment.