Visual Studio 2008 Error List showing spurious errors

Posted on 2009-02-09
Last Modified: 2013-12-17
My Visual Studio (developing applications) error list constantly shows hundreds of errors, even though there are actually none within the site. The errors are all of exactly the same type: 'The name xxx does not exist in the current context'. xxx refers to a server side control declaratively defined.  It seems like VS is checking the code behind files but isn't checking the declarative files when doing its checks.
The app builds without issue.

It's not killer, but it is annoying and makes it difficult to find genuine errors. I've applied all service packs and updates. Anyone encountered this and know how to fix it?
Question by:NazoUK
    LVL 53

    Expert Comment

    Found at another forum:  found out the that problem is cause by the back up copy from the same file (copy of default.aspx) that i forget to exclude from the project. The problem solved after i exclude the file from the project.
    LVL 53

    Expert Comment

    In your code behind you must create the member as well. When you drag/drop a control on you Layout View VS will generate this for you; otherwise you have to do it yourself. It isn't that hard:

    public class MyWebPage : System.Web.UI.Page
         protected System.Web.UI.WebControls.Panel pnlDescription;
         // ...
    LVL 15

    Author Comment


    Thanks for the response but I've checked my project and there aren't any backup files in there.
    Also, I've never heard of having to declare server controls in the code-behind as well and never seen it done in any of the books, blogs, articles etc I've read so I'm not convinced about that. Also I tested in VS layout view and it didn't automatically add anything.
    LVL 15

    Accepted Solution

    Turns out the problem is caused by a bug in Visual Studio SP 1.
    Detailed information and a Hotfix can be found at

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now