Intellisense problem in Visual Studio

cagayacagaya USMember

Hi there, I am runing my latest stable version of Xamarin on VisualStudio2015 update1 on windows 10, and I noticed some youtube video showed that they had intellisense in VS, which made me confused. The intellisense seems not working in my VS, and I did download an extension from vs gallary but it still did not work. Do I need to setup something?
Thanks for help

«1

Answers

  • GeraldVersluisGeraldVersluis NLUniversity ✭✭✭✭

    There seems to be a nasty bug in the VS IntelliSense so it probably isn't working right now. But will be soon after Xamarin has fixed and updated :smile:

  • dpedrinhadpedrinha DEMember ✭✭✭

    Brendan Zagaeski I see no changes here with your 2. approach.

    xml line still red and blue.

    I'm using latest version of VS2015

  • dpedrinhadpedrinha DEMember ✭✭✭

    @BrendanZagaeski Interesting, it worked.

    I guess I needed to close ALL tabs and restart to fix it.

    Thanks!

  • dpedrinhadpedrinha DEMember ✭✭✭

    @BrendanZagaeski But now I'm getting a lot of "The type 'ContentPage' could not be found... Check if it's not missing an assembly..." message for every item. Keep having to rebuild it to fix.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    now I'm getting a lot of "The type 'ContentPage' could not be found

    Hmm. I've never seen a report of the "could not be found" message for the 'ContentPage' type before. Indeed the only Google result for "The type 'ContentPage' could not be found" is this exact forum thread.

    If you can reliably hit that error by following some certain steps with a new template project, then I'd recommend starting up a new Stack Overflow question that precisely describes those steps so that the community and the Xamarin team can take a look for anything that might look out-of-place. Thanks in advance!

  • Arie_HeineArie_Heine ZAMember

    Was having the same problem using vs2015 community, noticed that after building the app intellisense appeared to work

  • amirjalaliamirjalali USMember

    @ben>; @BrendanZagaeski said:

    now I'm getting a lot of "The type 'ContentPage' could not be found

    Hmm. I've never seen a report of the "could not be found" message for the 'ContentPage' type before. Indeed the only Google result for "The type 'ContentPage' could not be found" is this exact forum thread.

    If you can reliably hit that error by following some certain steps with a new template project, then I'd recommend starting up a new Stack Overflow question that precisely describes those steps so that the community and the Xamarin team can take a look for anything that might look out-of-place. Thanks in advance!

    It shows: the type 'contentPage' was not found. verify that you are not missing and assembly reference and that all referenced assembly have been built.

    event after build the problem exist

  • GaryParkinGaryParkin USMember ✭✭

    This is not working for me either. Do I need to download something? Open in code editor gives me all black code.

  • LeeMorrisLeeMorris USMember ✭✭

    I was able to get this to work. I did follow the steps described here, I then restared Visual Studio, and built the solution.

  • asfendasfend USMember

    Any other alternative of Resharper ??

  • SmoggySmoggy USMember

    @BrendanZagaeski said:

    xml line still red and blue.

    @dpedrinha, interesting.

    • By "latest version of VS2015", I suspect that means you are using VS 2015 Update 2, correct?

    • To help gather other possible clues, do you have ReSharper installed by any chance?

    • In some of my tests, I think I might have seen a behavior where the XML line appeared red and blue when I had previously edited the file using the default editor. I suspect you've probably already tried something similar, but if you get a chance, you could double-check if the following steps change the behavior:

      1. Close all open tabs in the project.
      2. Quit Visual Studio.
      3. Reopen the solution in Visual Studio.
      4. Right-click the XAML file in the Solution Explorer and then select Open With... > Source Code (Text) Editor as before.

    This worked perfectly

    I took it one step further and set Source Code (Text) Editor as default so i can just open xaml as usual

  • @Smoggy Thanks! Your solution worked for me.

  • LucasPereiraLucasPereira USMember

    @amirjalali said:
    @ben>; @BrendanZagaeski said:

    now I'm getting a lot of "The type 'ContentPage' could not be found

    Hmm. I've never seen a report of the "could not be found" message for the 'ContentPage' type before. Indeed the only Google result for "The type 'ContentPage' could not be found" is this exact forum thread.

    If you can reliably hit that error by following some certain steps with a new template project, then I'd recommend starting up a new Stack Overflow question that precisely describes those steps so that the community and the Xamarin team can take a look for anything that might look out-of-place. Thanks in advance!

    It shows: the type 'contentPage' was not found. verify that you are not missing and assembly reference and that all referenced assembly have been built.

    event after build the problem exist

    Clean your solution.

  • @BrendanZagaeski Thanks very much Brendan. Your first solution worked for me after many futile attempts trying other things.

  • JonAlzaJonAlza ESMember ✭✭

    @BrendanZagaeski said:
    4. Right-click the XAML file in the Solution Explorer and then select Open With... > Source Code (Text) Editor as before.

    This solves my problem, but I clicked on "set as default". Now I have intellisense back.

  • @BrendanZagaeski said:
    To mention 2 quick notes that might be useful, in particular related to XAML IntelliSense (I indirectly assume that XAML IntelliSense is indeed the topic of this question based on the mention of "an extension from vs gallery"):

    1. Bug 38829 - Suspending ReSharper is currently not sufficient to re-enable the Xamarin.Forms IntelliSense extension. So if you have ReSharper installed but suspended, you will not get XAML IntelliSense. But there is a workaround (see 2).

    2. In my tests with VS 2015 Update 1, the "Enable XAML Language for Xamarin.Forms" extension had no effect on the behavior of the XAML IntelliSense. Workaround: I was able to achieve the desired behavior where the <?xml version="1.0" encoding="utf-8" ?> line was all blue (as shown in the screenshots on the page for the extension) by right-clicking the XAML file in the Solution Explorer and selecting "Open With... > Source Code (Text) Editor". This workaround gave me the desired XAML IntelliSense even without installing the extra "Enable XAML Language for Xamarin.Forms" extension and even with ReSharper installed but suspended.

      image

    This resolve my problem! Thankss!!

  • AndrewMobileAndrewMobile USMember ✭✭✭✭

    @BrendanZagaeski If I double clicked by mistake the .xaml file, is there a way to make Intellisense work without having to restart Visual Studio?
    It drives me nuts..

    Or, can I make Visual Studio always use "Open with Source Code (Text) Editor" the .xaml only for Xamarin Forms projects?

  • JonAlzaJonAlza ESMember ✭✭

    @AndrewMobile I solved my intellisense problem setting XAML Designer as default. I this case all XAML files will open with the designer (not available for Xamarin), but you can hide it with Collapse Pane and XAML buttons that are in the toolbar between designer and code (you have to hide the designer once for each xaml you open).

  • AndrewMobileAndrewMobile USMember ✭✭✭✭

    @JonAlza OK how do I do this: "setting XAML Designer as default" ?

  • JonAlzaJonAlza ESMember ✭✭

    @AndrewMobile The same way as "Source Code (Text) Editor", but selecting "XAML Desinger":
    Right click on XAML file -> click on "Open with..." option -> Select "XAML Desinger" in the list -> click on "Set as Default" button

  • jambarrjambarr USMember

    This is a show stopper for me. With all the differences in the various Android APIs, I need Intellisense to make sense of it all. Looks like I'm sticking with Android Studio. \//,

  • purvinpurvin USMember

    Intermittent problem : Elements declared in xaml don't resolve in its code behind. Red squiggly line appears. Following is one of the step that solves it.

    • Delete obj folder ( to remove ...g.cs files)
    • Clean project
    • Comment all your Xaml between opening root tags ( keep the root tag) i.e don't comment root tags.
    • Comment all code in code behind except the constructor call of InitializeComponent()
    • Rebuild it.
  • GirishPandeGirishPande USMember

    by deleting .suo file we can get the intellisense back ;)

  • voidstreamvoidstream FRMember ✭✭✭

    @BrendanZagaeski said:

    xml line still red and blue.

    @dpedrinha, interesting.

    • By "latest version of VS2015", I suspect that means you are using VS 2015 Update 2, correct?

    • To help gather other possible clues, do you have ReSharper installed by any chance?

    • In some of my tests, I think I might have seen a behavior where the XML line appeared red and blue when I had previously edited the file using the default editor. I suspect you've probably already tried something similar, but if you get a chance, you could double-check if the following steps change the behavior:

      1. Close all open tabs in the project.
      2. Quit Visual Studio.
      3. Reopen the solution in Visual Studio.
      4. Right-click the XAML file in the Solution Explorer and then select Open With... > Source Code (Text) Editor as before.

    Thanks guy :)

  • OscarRodriguezOscarRodriguez USMember ✭✭

    This two steps worked for me:
    1. Delete obj folder ( to remove ...g.cs files)
    2. Clean project

    thanks @purvin

  • dpedrinhadpedrinha DEMember ✭✭✭

    @OscarRodriguez said:
    This two steps worked for me:
    1. Delete obj folder ( to remove ...g.cs files)
    2. Clean project

    thanks @purvin

    Good to know that the Clean command is not working as supposed.

  • VovaKamishnikovVovaKamishnikov USMember ✭✭✭

    @BrendanZagaeski ..... Right-click the XAML file in the Solution Explorer and then select Open With... > Source Code (Text) Editor as before.

    Thanks a lot! It's working for me

  • @dpedrinha said:
    @BrendanZagaeski But now I'm getting a lot of "The type 'ContentPage' could not be found... Check if it's not missing an assembly..." message for every item. Keep having to rebuild it to fix.

    Check the VS dropdown. @BrendanZagaeski's solution works for me after edit this.

  • @BrendanZagaeski said:

    xml line still red and blue.

    @dpedrinha, interesting.

    • By "latest version of VS2015", I suspect that means you are using VS 2015 Update 2, correct?

    • To help gather other possible clues, do you have ReSharper installed by any chance?

    • In some of my tests, I think I might have seen a behavior where the XML line appeared red and blue when I had previously edited the file using the default editor. I suspect you've probably already tried something similar, but if you get a chance, you could double-check if the following steps change the behavior:

      1. Close all open tabs in the project.
      2. Quit Visual Studio.
      3. Reopen the solution in Visual Studio.
      4. Right-click the XAML file in the Solution Explorer and then select Open With... > Source Code (Text) Editor as before.

    It works for me .

  • MeigstonMeigston USMember ✭✭

    @BrendanZagaeski said:
    To mention 2 quick notes that might be useful, in particular related to XAML IntelliSense (I indirectly assume that XAML IntelliSense is indeed the topic of this question based on the mention of "an extension from vs gallery"):

    1. Bug 38829 - Suspending ReSharper is currently not sufficient to re-enable the Xamarin.Forms IntelliSense extension. So if you have ReSharper installed but suspended, you will not get XAML IntelliSense. But there is a workaround (see 2).

    2. In my tests with VS 2015 Update 1, the "Enable XAML Language for Xamarin.Forms" extension had no effect on the behavior of the XAML IntelliSense. Workaround: I was able to achieve the desired behavior where the <?xml version="1.0" encoding="utf-8" ?> line was all blue (as shown in the screenshots on the page for the extension) by right-clicking the XAML file in the Solution Explorer and selecting "Open With... > Source Code (Text) Editor". This workaround gave me the desired XAML IntelliSense even without installing the extra "Enable XAML Language for Xamarin.Forms" extension and even with ReSharper installed but suspended.

      image

    It works for me.

  • LaserLaser RUMember ✭✭
    edited January 2017

    Hello!

    I have the same problem with VS2015 and the latest stable version of Xamarin. I have no ReSharper installed, and Intellisence doen't work in .axml files. Some time ago (probably, before last Xamarin update) i have Intellisence working on .axml file, when I edited TextView attributes using dimensions from Resource.Designer.cs. For example, this value I've collected from the drop-down list:
    <TextView android:textSize="@dimen/abc_text_size_medium_material" />
    My questions are:
    1. How can I get back the drop-down list of attributes from Resource/Resource.Designer.cs?
    2. How can I get general Intellisence in .axml files?

    I've tryed to clean the project, checked if schemas in VS enabled (https://developer.xamarin.com/guides/android/troubleshooting/questions/enable-axml-intellisense/) and tryed to use Source Code Text Editor (only black text is viewed).

    Thanks!

  • GerritVoornGerritVoorn NLMember

    I have updated and tried everything they told in this post, but intellisense is not working for XAML files (Xamarin.Forms) in visual studio 2013 and 2015.
    Please Xamarin, Is there another solution for this problem that absolute works?

  • Does that work with VS2015 update 3?
    I have the same problem XAML intellisense is not working

  • abkabk USMember

    @BrendanZagaeski said:
    To mention 2 quick notes that might be useful, in particular related to XAML IntelliSense (I indirectly assume that XAML IntelliSense is indeed the topic of this question based on the mention of "an extension from vs gallery"):

    1. Bug 38829 - Suspending ReSharper is currently not sufficient to re-enable the Xamarin.Forms IntelliSense extension. So if you have ReSharper installed but suspended, you will not get XAML IntelliSense. But there is a workaround (see 2).

    2. In my tests with VS 2015 Update 1, the "Enable XAML Language for Xamarin.Forms" extension had no effect on the behavior of the XAML IntelliSense. Workaround: I was able to achieve the desired behavior where the <?xml version="1.0" encoding="utf-8" ?> line was all blue (as shown in the screenshots on the page for the extension) by right-clicking the XAML file in the Solution Explorer and selecting "Open With... > Source Code (Text) Editor". This workaround gave me the desired XAML IntelliSense even without installing the extra "Enable XAML Language for Xamarin.Forms" extension and even with ReSharper installed but suspended.

      image

    Thanks @BrendanZagaeski, it worked perfectly for me! :smile:

  • carliecodecarliecode USMember

    Thanks its working for me too.

  • AndyHeatonAndyHeaton USMember

    I have tried everything in this post and am not getting it to work. Following the steps has reduced me from getting some of the intellisense (I have never seen HorizontalOptions or VerticalOptions, I typed those out), but now I just see the x, xmlns, etc options. Does anybody know what's going on here?

    I am using VS2015 Community with Xamarin 4.2.2.11 and Xamarin.Forms v2.3.3.180. Is there a xaml intellisense NuGet package I'm supposed to have? I have had so many errors just getting Xamarin configured to even start a tutorial, it's crazy haha! I would love to get learning Xamarin but it seems like there is just one bug after the other.

    I keep getting errors that make it seem like VS loses sight of basic objects like 'ContentPage' and 'Button'. It loses sight of the Android SDK even though I've got VS pointed to it. Has anybody who has seen these problems figured out how to fix them?

  • PaulLambertiPaulLamberti USMember ✭✭
    edited February 2017

    I've spent the last day trying to get this to work with no luck. I'm using Visual Studio Professional 2015 Update 3. Its a show stopper if I can't get intellisense working (properly). Looks like back to Xcode. You would think someone from Xamarin would chime in. Please Help.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai

    You would think someone from Xamarin would chime in

    Note that most of the previous responses in this thread have been "its working for me."

    For troubleshooting a new scenario that is not resolved by the steps from earlier in this thread, I would recommend creating a fresh forum thread or Stack Overflow question. Thanks!

Sign In or Register to comment.