I have a Strange issue that I can't seem to fix, my Intellisense for XAML is no longer showing up and the code behind is only showing the premade Members. The Classes and Methods I have made are not showing up. Also Visual Studios is not recognizing other pages and wont recognize Navigation either.
I have tried going to Tools>Text Editor>C#>Intellisense -Statement completion and checking the boxes Auto list members and Parameter information. I also tried to clear out the cache.
From what I have researched it seems nobody else is having the same problems.
- Close all open tabs in the project and quit VS, reopen the solution in VS and right click the XAML file in the Solution Explorer and then select Open With….> Source Code (Text) Editor.
- Delete obj folder and clean project
- Right click the XAML page>Properties>Build Action>change it to something else and back
- Add a new content page under this specific project and check it works or not.
I would like to add that this worked for my .cs files only.
To get the XAML files Intellisense to work try to repeat the above steps on your .cs files or wait for the XAML files to gain Intellisense.
For ReSharper users: I found that having ReSharper's IntelliSense enabled for all languages can break Intellisense unexpectedly (especially for XAML files). Here's how I was able to fix the same problem that the asker had in Visual Studio 2017 with ReSharper installed:
- In Visual Studio, go to the ReSharper menu and click on Options.
- On the left side go to Environment > IntelliSense > General.
- Select the Custom IntelliSense radio button.
- Change any languages that have broken IntelliSense to Visual Studio (like XAML).
- Click the Save button.
Just Exclude and Include Xaml Pages and It works again.
I solve that by changing the default editor in visual studio :
- In Visual : File > Open
- In the open file box : Select a .xaml file (don't open it)
- Select "Open with" in the button arrow
- Select "Source Code (Text) Editor and Set as Default
- Click OK
I tried most of the above without much luck, but noticed if I created a new page, then intellisense worked as expected. For the properties section of the xaml file I noticed that the new page had a Custom Tool assigned (MSBuild:UpdateDesignTimeXaml) do I tried to cut-and-paste this into the existing forms without luck.
Looking at the .cs page for the new page that worked I notice that there is some extra info above the partial class [XamlCompilation(XamlCompilationOptions.Compile)] so I added this along with a using Xamarin.Forms.Xaml statement.
Finally I went back to the xaml properties page and selected Reset to Default for the Custom tool. Voila, for me everything started behaving itself.
Please add the following Nuget Package from Nuget Console.
Install-Package MobileEssentials.FormsIntellisense -Version 0.1.1-pre
You can download the latest update from the following link.
https://www.nuget.org/packages/MobileEssentials.FormsIntellisense/0.1.1-pre
After installing the package please restart the project and wait for sometime and check it.
Just delete .vs directory. this directory is hidden. so