Search code examples
c#.netvisual-studiovisual-studio-2012

Visual Studio compiles fine, but it still shows red lines


I am using Visual Studio 2012 and it was working all fine until I started observing some funny behavior. When I open my code it shows red Underlines which we usually see when there is an error in our code. Surprisingly, the code compiles all fine. I have made following observations that are not normal at all.

  1. Red underlines in the code
  2. While cleaning or building the solution no error.
  3. Red underlines go away for some time after I build/clean the solution, but they come back eventually.
  4. Because of this, my IntelliSense stopped working.
  5. I can not right click on any component and go to its definition.

Any ideas?


Solution

  • Delete the contents of the temporary ASP.NET folder and then rebuild. It'll either be in your user folder (for IIS Express - \AppData\Local\Temp\Temporary ASP.NET Files) or the Windows directory (for IIS - C:\Windows\Microsoft.Net\Framework\vx.xx\Temporary ASP.NET Files)

    Paths are off the top of my head and may not be correct