Cannot get Xamarin Xaml Intellisense to work in VS 2015

I have been trying to get intellisense to work for quite some time now and I don't see anything outside

! ![CDATA[ ? 
  • Visual Studio 2015 Update 2
  • Resharper is installed but disabled.
  • Link to the latest pre-release versions of Xamarin Forms (2.3.0.38-pre2)
  • Xamarin for Visual Studio (4.2.21)
  • Portable project referencing the correct target file 2.3.0.38-pre2 from NuGet
  • Enable XAML for Xamarin.Forms

What else am I missing? I feel it shouldn't be that hard.

+8
visual-studio-2015 xaml xamarin xamarin.forms intellisense
source share
10 answers

I solved this problem by following a simple approach and here is the solution.

Right-click the XAML file in Solution Explorer and select

Solution 1: "Open with ...> Source Code Editor (text) ."

and at other times this also worked for me:

Solution 2: "Open with ...> Source Code Editor (text) with encoding "

This workaround gave me the desired XAML IntelliSense even without installing the optional “Enable XAML language for Xamarin.Forms” extension and even with ReSharper installed but paused.

+15
source share

Extensions> Tools> Enable XAML for Xamarin.Forms

Enable XAML for Xamarin.Forms

Allows the built-in XAML VS language service to provide editing and intellisense for XAML Xamarin.Forms files.

https://visualstudiogallery.msdn.microsoft.com/8195a8e2-a842-4389-a8cb-34e4672e2e13

Update:

From @Jeff:

It seems I had to completely remove Resharper, and not just disable it. Then reinstall "Enable XAML for the Xamarin Forms Extension."

Additional Information:

http://www.cazzulino.com/enable-xaml-forms-intellisense.html

Xamarin XAML Included:

enter image description here

XML is included and therefore no Xamarin XAML Intellisense:

enter image description here

+7
source share

The reason Intellisense is not displayed in the editor is because Xamarin XAML does not open as a file with the xaml content type, but a file with the xml content type .
To open the xamarin XAML file as a file with the content type xaml, simply in the solution browser, right-click the xaml file and select Open with .... From the pop-up menu, select "XAML Designer Encoding." and click OK .


Below is the solution if you are editing Xamarin xaml as a file with xml content type. But this solution is wrong, IntelliSense does not always offer the right solution.

To take advantage of Intellisense the Visual Studio must get appropriate definition of xml namespace for Xamarin.Forms. For the Xamarin.Forms Visual Studio needs xml definition for namespace http://xamarin.com/schemas/2014/forms .
This definition can be provided by Visual Studio in two ways:

  • You can use the xsd file and this file, and then register in xml-schemes - after you open the xaml file, the Xml / Schemas menu will appear.
  • This definition can be created using the assembly attribute XmlnsDefinitionAttribute . This attribute can be found in the Portable.Xaml nuget package.

Suitable for Xamarin.Forms - the second way (using the attribute).

If you use Xaml in a portable library, restore (download and install) this nuget package to this library.
If you are using a shared project, restore this nuget package for all projects referencing this shared project.

Then paste this attribute in the appropriate place. I believe that App.xaml.cs (if you use the generated App name) is a good place. The code might look like this:

 using Portable.Xaml.Markup; using Xamarin.Forms; [assembly: XmlnsDefinition("http://xamarin.com/schemas/2014/forms", "Xamarin.Forms")] namespace YourAppNamespace { public partial class App : Application { public App () { this.MainPage = new MainPage(); } } } 

And the rebuild solution, it seems to me, may not be practical for Intellisense for Xamarin.Forms to work. C>

+5
source share

I install Extension Enable XAML language for Xamarin.Forms from

Enable XAML for Xamarin.Forms

However, intellisense did not work. I just need to close all the tabs and close the visual studio. After re-starting Visual studio, I open the solution and the XAML file. instellisense working fine.

+4
source share

This worked for me:

right-click on the .xaml file and select "Open with .." and select "XAML Designer" and also "Set as Default" , then intellisense did a great job.

enter image description here

+3
source share

worked for me Right-click on your XAML file and select the option Open with => Editor for source code (text) with encoding => Set as default => Apply and select the Auto .... option

+2
source share

It seems I had to completely remove Resharper, and not just disable it. Then reinstall the Enable XAML language for the Xamarin Forms extension.

+1
source share

Jeff's answer almost worked for me, but I had to take another step:

Since I previously uninstalled and reinstalled Xamarin, I had to upgrade from 4.0.1 to the latest stable version (4.1.1.3 at this date). After that Intellisense started to work!

0
source share

I have Resharper installed on VS2015update3, and XAML Designer does not work for me.

But by chance I found an XML (text) editor . This is a Resharper that makes an effet.

  • No wave line under the tag.
  • The perfect offer everywhere: XML tags, properties, available values

Only things: it's not too much color, and F7 doesn't send me code.

Voilà, hope this helps

0
source share

I solved this problem by following a simple workaround, and here is the solution.

Right-click the XAML file in Solution Explorer and select

Solution 1: "Open with ...> Source Code Editor (text)."

and at other times this also worked for me:

Solution 2: "Open with ..." Source Code Editor (text) with encoding "

Actually, I found that it even worked for me simply: Solution 2: "Open with ...> Automatic Editor Selector (XML)" and then open VS again.

I also found that the problem started after editing the .xaml file outside of VS, by right-clicking on the file and selecting “Modify”.

0
source share