• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 320
  • Last Modified:

Visual Studio 2008 Error List showing spurious errors

My Visual Studio (developing asp.net 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?
0
NazoUK
Asked:
NazoUK
  • 2
  • 2
1 Solution
 
DhaestCommented:
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.

http://dotnetfish.blogspot.com/2007/08/name-xxx-does-not-exst-in-current.html
0
 
DhaestCommented:
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;
     // ...
 
0
 
NazoUKAuthor Commented:
Hi,

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.
0
 
NazoUKAuthor Commented:
Turns out the problem is caused by a bug in Visual Studio SP 1.
Detailed information and a Hotfix can be found at

http://support.microsoft.com/kb/957259
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now