Forum Visual Studio

Intellisense (C#) not working for XAML objects?

DomiBDomiB BEBeta, University ✭✭

If I create a blank sample Forms .net Standard project with the latest VisualStudio for Mac (Version 7.5 (build 1254)) & latest forms; and I add e.g. a named label in my MainPage, I don't get any completion for it in my code behind file. (not for the variable, nor for methods/properties). I can find the variable if I search for it with find in files.

Posts

  • DomiBDomiB BEBeta, University ✭✭

    Also, If i close & reopen the projects I get squiggly lines and "Ambiguity Between....." messages, look at screenshot attached.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited May 2018

    Visual Studio Developer Community cross-reference for the "Ambiguity between" message

    https://developercommunity.visualstudio.com/content/problem/248182/xamarin-resources-indicate-duplicates.html

    At least for that part of the behavior, I would recommend to vote on an follow that Developer Community report for updates and fix notifications.

  • NozomuYasuiNozomuYasui JPMember

    I also have updated VS2017 for Mac to ver.7.5.1 today and Xamarin.Forms to 3.0.0.481520. I see same red underline for initalizeComponent() and also IntelliSense doesn't work on Xaml created control to show property and methods.

    I downgraded the Xamarin.Forms NuGet package to 2.5.1.527436. it looks woking fine now. Which version of Xamarin.Forms are you using?

    Seems like VS2017 7.5.1 doesn't know Xamarin.Forms 3.0 for code behind output file (/obj/Debug/MyPage.xaml.g.cs)
    VS always output "2.0.0.0" for control version as below.

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "2.0.0.0")]

    Hope this help...

  • DomiBDomiB BEBeta, University ✭✭

    That seems to be the problem indeed! Downgrading to Forms 2.5.x fixed the problem for me.

  • BenoistLUGNIERBenoistLUGNIER FRMember ✭✭

    Any workaround ?
    This is a real problem. Please fix it

  • BenoistLUGNIERBenoistLUGNIER FRMember ✭✭

    At first, be sure that the "open with" option for xaml file is set to "Source Code (text) Editor"
    upgrading to XF 3.0.0.482510 seems to fix the intellisense problem
    If you have resharper, set xaml intellisense to Visual Studio not to Resharper

  • NozomuYasuiNozomuYasui JPMember

    Just confirmed this issue fixed with 7.5.2 May,30 release.

Sign In or Register to comment.