locked
Intellisense (C#) not working for XAML objects? RRS feed

  • Question

  • User2051 posted

    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.

    Friday, May 11, 2018 8:01 PM

All replies

  • User2051 posted

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

    Friday, May 11, 2018 8:05 PM
  • User13824 posted

    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.

    Friday, May 11, 2018 9:20 PM
  • User100941 posted

    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...

    Wednesday, May 16, 2018 5:23 PM
  • User2051 posted

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

    Wednesday, May 16, 2018 5:43 PM
  • User150697 posted

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

    Saturday, May 19, 2018 6:21 AM
  • User150697 posted

    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

    Saturday, May 19, 2018 7:10 AM
  • User100941 posted

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

    Tuesday, June 12, 2018 5:38 AM