Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Intellisense not working on XAML only on very specific circumstances

I'm making a new UserControl, and when I opened it the XAML was not working.

I thought that this was odd, as when I was working on my MainWindow it was working just fine. So I checked on my MainWindow. It still works there. Also in C# code.

However, if I press CTRL +        it still comes up fine.

I'm not quite sure why. I went to Tools➾Options➾Text Editor➾XAML➾General, and the Text Completion section is greyed out (e.g. Auto-List Members, etc.). This is also greyed out when I see it on my main window, but Intellisense works there.


Could someone help me? My VS version is VS2012 Express, Update 2. The only extension installed is XNA (using this "hack").

like image 721
It'sNotALie. Avatar asked Jun 10 '13 07:06

It'sNotALie.


People also ask

Why is IntelliSense not working in Visual Studio?

If IntelliSense in Visual Studio 2019 stopped working, the issue could be related to NuGet. In this case, to resolve the issue, just delete the contents of the packages folder. Close all instances of Visual Studio 2019. Delete the contents of the packages folder at the root of your local machine.

Why IntelliSense is not working?

If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve the issue. If you are still missing IntelliSense features after installing a language extension, open an issue in the repository of the language extension.

How do I enable IntelliSense in Visual Studio?

To access this options page, choose Tools > Options, and then choose Text Editor > C# > IntelliSense.


2 Answers

Huh. I just restarted it and it worked again. The problem is that before, when I restarted it, it still did not work. I haven't found the underlying issue, but it's fixed now.

like image 97
It'sNotALie. Avatar answered Oct 18 '22 18:10

It'sNotALie.


There are several reasons why Intellisense may fail and if you have several factors in play you will have to do several things to get it to work and so I've listed some of the things that I've done to solve this issue in the past.

Make sure you are using either the XAML UI Designer or the Source Code (Text)Editor for editing XAML with Intellisense. The XML (Text) editor does not provide Intellisense on my installation (VS2013 Pro).

If the designer crashes due to an exception in a loaded assembly you may also lose Intellisense. Fix the exception to restore it.

The designer may not load correctly if an assembly in your project is not trusted and has been sandboxed, and this can affect Intellisense.

See the following articles for more information on sandboxing and granting full trust:-

http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx

http://msdn.microsoft.com/en-us/library/ee890038(v=vs.110).aspx

Obviously only grant full trust to assemblies that you trust!

To grant full trust to an assembly, browse to the assembly in Windows Explorer and open the file properties and unblock the assembly (see image below).

enter image description here

Also, deleting .suo files can clear intermittent Intellisense problems.

like image 28
The Lonely Coder Avatar answered Oct 18 '22 18:10

The Lonely Coder