?
Solved

Visual Studio 2008 Error List showing spurious errors

Posted on 2009-02-09
5
Medium Priority
?
313 Views
Last Modified: 2013-12-17
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
Comment
Question by:NazoUK
  • 2
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 23598019
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
 
LVL 53

Expert Comment

by:Dhaest
ID: 23598020
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
 
LVL 15

Author Comment

by:NazoUK
ID: 23620888
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
 
LVL 15

Accepted Solution

by:
NazoUK earned 0 total points
ID: 23815507
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

864 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