You might have seen this before: You open a project in Visual Studio, and almost every possible keyword is underlined red. Building works just fine, but the editor and Intellisense just freak out. In my case, working in a Windows Phone project, I couldn’t select the target (Device, Emulator 512, etc) in the combo box next to the “Run” button in the taskbar. It only showed “Start”.
Having just installed Xamarin, I first thought that it was the culprit. Or maybe Resharper. Anyway whatever the cause was (and I am still not 100% sure what actually triggered this behavior), recovering from it is actually quite easy:
- Close Visual Studio
- Delete the SUO file
- Restart Visual Studio.
The SUO file is a hidden file,, which is placed in the same folder as the SLN file. It contains a lot of information such as which files are currently open in the IDE, some local settings, etc. Personally I hate this file because it can cause a lot of trouble if it gets corrupted. And since it is hidden, you don’t always think about it.
So the rule is: If you see some weird behavior in Visual Studio, try to delete the SUO file first, before you try anything else.
Update: I was just told that unloading and reloading the project file might help too. I suspect that under the cover this also modifies the SUO file and solves the issue. Good to know :)