Intellisense and code highlighting for Xamarin.Forms using .NET Standard

JonathanDibbleJonathanDibble ✭✭GBMember ✭✭

I have ported my my Xamarin.Forms core project over to .NET Standard.

Ever since I have done this I have lost all intellisense and code navigation. All the code highlighting is all over the place with 10s/100s of method calls all highlighted like an error.
Even typing /// to add a comment above a method fails to do anything.

I have deleted the userprefs file and this has resolved the code highlighting, but all intellisense and code navigation is still missing

By adopting the latest core approach I have now got a disastrous coding experience. Or I am I expecting to much.

Posts

  • mattwardmattward Xamurai GBMember Xamurai

    Not sure what the problem is. Are there any errors in the IDE log? Also what does the contents of your .NET Standard project look like?

  • JonathanDibbleJonathanDibble ✭✭ GBMember ✭✭

    There seems an awful lot in these log files, trashed them all this morning, loaded up Vs4Mac and opened up the solution. Here is the ide.log file. The project file for the .NET Standard project is here too.

    At some point yesterday the xaml files and the xaml.cs code behind files became separated as if the DependentUpon tags in the project had no effect. This morning everything is back as it should be?????

  • mattwardmattward Xamurai GBMember Xamurai

    Using <EnableDefaultCompileItems>false</EnableDefaultCompileItems> seems to be causing VS Mac 7.2.2 some problems which I will look into.

    If you remove the EnableDefaultCompileItems property from the project file and all the .cs and .xaml and .xaml.cs items from your project then code completion seems to work. Xamarin.Forms 2.4 includes default msbuild items for .xaml and .xaml.cs items so they do not need to be explicitly listed in the project file.

  • mattwardmattward Xamurai GBMember Xamurai

    OK it looks like I ran into this problem before - https://bugzilla.xamarin.com/show_bug.cgi?id=57109

  • JonathanDibbleJonathanDibble ✭✭ GBMember ✭✭
    edited November 2017

    @mattward Thanks for the quick response, I have made that change, but now I get a whole stream if CS0103 errors in my code behind files.
    Most notably Error CS0103: The name 'InitializeComponent' does not exist in the current context (CS0103) but also for controls I have referenced in the xaml file via the x:name=

  • JonathanDibbleJonathanDibble ✭✭ GBMember ✭✭

    @mattward Sorry I only read your second post (didnt see your first) and made the changes described on bugzilla page. I will try out your initial suggestion

  • JonathanDibbleJonathanDibble ✭✭ GBMember ✭✭

    @mattward Thank You !!!

    Your suggestion works perfectly. I had to close down VS4Mac and re-open it (and the project) to get the code behind file to sit correctly under the xaml files.

    Thank you for your help!! :)

Sign In or Register to comment.