2

So I'm working on a Xamarin project and suddenly Visual studio 2015 started freaking out it shows error red lines under every thing nearly for example :

InitializeComponent();

in every page is red lined ,the project builds and runs without error, the errors are coming from Intellisense only I looked for a solution on the net many posts talked about this issue but none had a working solution for me.

so here is what I tried:

1)deleting the .suo file

2)deleting xamarin temp folder (and eventually I deleted everything in the temp folder)

3)Build/Clean - Build/Rebuild

4)tried to locate the sdf Intellisense file but found none

5)many talked about reshaper problems but I don't have it.

6)the project is not on git so this also is not the problem

7) tried to delete the /bin and /obj also with no luck

I'm getting crazy about this can someone help with this one?

Fadi Banna
  • 554
  • 1
  • 10
  • 26
  • Do you have ReSharper installed? This happens to me now and then and there are plenty of posts about it. You can try deleting the `/bin/` and `/obj/` folders from each project, close Visual Studio, reopen it, and rebuild everything. There are also some Visual Studio caches you can clear (search around for those). – hvaughan3 Dec 03 '16 at 23:13
  • I already stated that I don't have reshaper, and forgot to mention that I tried to delete the bin and obj I'll edit the post:) – Fadi Banna Dec 03 '16 at 23:19
  • and as I stated I looked at all the posts and did everything they suggested with no luck – Fadi Banna Dec 03 '16 at 23:21
  • Well if you look at my post and your edit, you will see that I commented before you added all of that stuff. Good luck to you – hvaughan3 Dec 03 '16 at 23:22
  • no all the stuff I tried was there :) I just added the bin and obj thing and re -orginized the rest to be on separate lines:) – Fadi Banna Dec 03 '16 at 23:24
  • Well damn, must have looked right past it. You might try reinstalling libraries by running `Update-Package -Reinstall` from the **Package Manager Console** window. Also do you use any source control other than Git? – hvaughan3 Dec 03 '16 at 23:32
  • no I don't use any source control right now , and tried the Update-Package -Reinstall and got this error : Unable to gather dependency information for multiple packages – Fadi Banna Dec 03 '16 at 23:44
  • Was the project created using a different version of Visual Studio than you are currently using now? When you look at your references, do they have little yellow icons by them? – hvaughan3 Dec 03 '16 at 23:58
  • No it was not I created it and worked on it for days it was fine suddenly without any significent change this stated to happen – Fadi Banna Dec 04 '16 at 00:02
  • Was thinking this morning and wondered if it happened if you created a brand new project? If not, and I know this might be painful and would not prevent it from happening again, but you could create a new project and move all of your stuff over to the new one. – hvaughan3 Dec 04 '16 at 19:06
  • 1
    I was going to do exactly that though i tried to avoid it in every way, but out of no where the problem was solved in somewhat weird fashion, I uninstalled xamarin forms from my project in the Package manager and tried to install it back again to see if that helps but it didn't, in a desperate act I took a look at the updates available in the package manager and there was one for xamarin I didn't believe it will solve the problem since the project ran fine on the current version,but tried it anyway for my surprise the problem was solved. – Fadi Banna Dec 04 '16 at 19:48
  • It seems the update does something that the reinstall didn't somehow! Thanks a lot for your help :) – Fadi Banna Dec 04 '16 at 19:49
  • Very strange but I am glad you figure it out! Make a copy of that code and never touch the copy again just in case ;) – hvaughan3 Dec 04 '16 at 19:53
  • @FadiBanna, since your issue is solved, you can try to share your solution as a reply, then mark it as answer, that will help other community members who have the same or similar issue to easier search this useful solution. – Sara Liu - MSFT Dec 05 '16 at 06:04
  • Did you try to delete `.suo` file? In my projects usually working – Enrico Dec 05 '16 at 14:05
  • I did my friend read the post closely i did state that this is the first thing I tried :) – Fadi Banna Dec 05 '16 at 14:06
  • Possible duplicate of [Visual Studio 2015: Intellisense errors but solution compiles](http://stackoverflow.com/questions/31943634/visual-studio-2015-intellisense-errors-but-solution-compiles) – gbjbaanb May 18 '17 at 23:28

1 Answers1

0

As requested I'm sharing what solved the problem for me, I uninstalled xamarin forms from my project in the Package manager and tried to install it back again to see if that helps but it didn't, in a desperate act I took a look at the updates available in the package manager and there was one for xamarin I didn't believe it will solve the problem since the project ran fine on the current version,but tried it anyway for my surprise the problem was solved, It seems that the update fixed some files that the reinstall didn't for some reason.

Since I don't think this can be called a solution since not every time this will happen there will be an update available to sort the issue, I came to a conclusion that the only thing to certainly fix the issue is to open a new project and painfully migrate your code to the new project, This will surely solve the problem but is a painful process.

Fadi Banna
  • 554
  • 1
  • 10
  • 26