vs 2017 intellisense not working C# and XAML
Asked Answered
P

9

6

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.

Proptosis answered 16/8, 2017 at 18:14 Comment(11)
We're having intellisense issues with ASP.Net Core 2.0 .cshtml tag helpers using the new VS 2017 15.3Salangia
I am using Xamarin Forms Content pages not .cshtmlProptosis
Does this happen for one project/solution? If yes, try deleting the .suo file that resides next to the .sln file. You can also just rename it. Then open the solution again.Migrant
Yes this only happens for one project. But when I Searched for the .suo file I found nothing.Proptosis
The .suo file is hidden by default. Also if you have a .vs folder (also can be hidden) you can delete that too.Saenz
Deleting the .suo file and the .vs folder didn't fix the issue.Proptosis
@CalebR, 1: 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. 2: Delete obj folder and clean project 3: Right click the XMAL page>Properties>Build Action>change it to something else and back 4. Add a new content page under this specific project and check it works or notUnconsidered
@Sara-MSFT, The Steps that u gave me only fixed my .cs files, my XAML files are still without Intellisense, but thank you a lot for helping to get my Intellisense in my .cs files to workProptosis
@Sara-MSFT, Nvm, my Intellisense for my XAML files just started to work Thanks for all the help.Proptosis
@CalebR, how did you made the XAML file get the intellisense, please share your solution as a reply and mark it, then will help other community members who meet the same issue, thanks.Unconsidered
@Sara-MSFT I honestly don't know how I got my XAML files to get intellisense, at first when I realized that my XAML files didnt get intellisense I tried to repeat the steps that you gave me on my .cs files. But that didn't work so I then decided to be satisfied with what I got and started to work on my project about 3 hours later when I started work in my XAML files I realized my Intellisense was working again. So I don't know how I got my XAML files to get Intellisense back.Proptosis
P
19
  1. 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.
  2. Delete obj folder and clean project
  3. Right click the XAML page>Properties>Build Action>change it to something else and back
  4. 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.

Proptosis answered 18/8, 2017 at 13:46 Comment(0)
E
4

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:

  1. In Visual Studio, go to the ReSharper menu and click on Options.
  2. On the left side go to Environment > IntelliSense > General.
  3. Select the Custom IntelliSense radio button.
  4. Change any languages that have broken IntelliSense to Visual Studio (like XAML).
  5. Click the Save button.
Endoparasite answered 7/2, 2018 at 4:4 Comment(0)
C
3

Just Exclude and Include Xaml Pages and It works again.

Casarez answered 16/2, 2018 at 9:33 Comment(0)
A
0

I solve that by changing the default editor in visual studio :

  1. In Visual : File > Open
  2. In the open file box : Select a .xaml file (don't open it)
  3. Select "Open with" in the button arrow
  4. Select "Source Code (Text) Editor and Set as Default
  5. Click OK
Athapaskan answered 19/10, 2017 at 12:15 Comment(0)
P
0

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.

Printer answered 11/2, 2018 at 5:16 Comment(0)
A
0

Please add the following Nuget Package from Nuget Console.

Install-Package MobileEssentials.FormsIntellisense -Version 0.1.1-pre

enter image description here

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.

Alms answered 15/8, 2018 at 15:28 Comment(0)
A
0

Just delete .vs directory. this directory is hidden. so

Acarpous answered 11/10, 2018 at 3:28 Comment(0)
A
0

Just Exclude and Include Xaml Pages worked for me too. The difference in .csproj file was: MSBuild:Compile now: XamlIntelliSenseFileGenerator

Amelioration answered 5/6, 2019 at 16:16 Comment(0)
V
0

I could fix the issue in VS2019 by launching the VS installer to modify it, un-check and check the workload ‘.NET desktop development’ to re-install it.

Vivl answered 21/12, 2020 at 23:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.