Visual Studio - Library References and Intellisense

I've been fighting with this for quite some time... I have a large Android project, that uses multiple class libraries. Some of which reference other class libraries.

In the main application, I reference all of the libraries. Some of these libraries reference each other as well.

I cannot get intellisense to properly find all the classes in all the libraries. Red squiggles abound!! However everything compiles and runs fine.

This has been a problem for years, and usually removing the reference and re-adding it will temporarily fix the problem. Sometimes, unloading the class library project and reloading it will do the trick.

However, this is getting quite annoying and I wish I could resolve it once and for all.

I have rebuilt the project from scratch multiple times, and the problem persists.

Is this just me? Or is this something others experience?

Posts

  • MichaelHartmanMichaelHartman USMember ✭✭

    Crickets... Just me I guess

  • leramirez55leramirez55 USMember
    edited June 2016

    Have you tried resetting Visual Studio. I was having issues with the IOS, Android plugin not loading, and generic issues getting nuggets restored.

    Maybe you could try that?

  • MichaelHartmanMichaelHartman USMember ✭✭

    This has been persistent over different machines, versions of Visual Studio and Xamarin, full reinstalls of windows and Visual Studio. and has been happening for many years now. I have upgraded my entire development hardware multiple times during this period and yet it still happens.

    I suspect it may have to do with the way the projects exist in the solution, and maybe the fact that my solution has multiple class libraries and multiple android apps all referencing those libraries.

    4 different apps, 10 different class libraries all in one solution. It may not like that. These apps all interact as part of a suite.

  • leramirez55leramirez55 USMember

    Here is a couple of things you can check:

    Unload all the projects and add them one by one until you find the first instance of a project that has the issue where the intellisense does not work.

    Then Check:

    1. Build order. You can check that the project dependencies in the solution are correct by right clicking on the solution file and selecting Project Build Order...

    2. Nugets:

      2a. Referencing External Projects: If you use nuget restore and there is a project that lives outside the solution the references will be "broken" as they now reference the packages folder of the solution.

      2b. If you are using nuget restore with visual studio and are using git sometimes merging the project files results in weirdness when the merge goes wrong.

    Currently we have 3 projects for our main app project that directly reference (by adding the project to the solution, and using project references) 3 library projects that we load from external location. And that seems to work well. But Internally my team has moved to Paket packet manager to avoid issue#2(a, and b).

    We have not had any more issues since this change when collaborating.

    Good luck! Hopefully this can be solved.

  • StephenOakmanStephenOakman GBMember

    Same issue as Michael. When I add a new project reference, I get the red squiggles over the code but it builds and runs fine. The only thing that fixes this at the moment is to quit and reopen. Then it's OK again. This is both with Xamarin Studio and Visual Studio for Mac Preview 4.

Sign In or Register to comment.