views:

151

answers:

3

The Visual Studio Error List shows like 50 errors about controls and variables not existing. I double click an error, it takes me to it, and after about 1 second they all go away!

There aren't any real errors, as my site compiles without errors or even warnings.

I know I've seen this before, but I forget how to fix it. Anyone know why this is happening? Thanks in advance!

A: 

I've seen this before but I'm not sure what the actual cause is. I've seen it most using a website ASP.NET project rather than a web application ASP.NET project, but I don't know for certain that that's the cause.

That said, in my opinion you should use a web application style project anyway as it will pre-compile the most important portions of your application before deployment.

Randolpho
+3  A: 

I see it often too on web sites. I always have chalked it up to the compiler needing to "catch up" although I'm sure there is a more sophisticated answer to why that happens. It's annoying.

Cody C
I think it's not so much the compiler "catching up" as it is the compiler simply not having referential options at all. They don't have .proj files at all. Unless a class file happens to be open, Visual Studio doesn't know about it.
Randolpho
A: 

The solution to this problem:
open the *.aspx.cs page and after about 1 second they all go away

ecounysis