Drydo's Blog

Teenager of the Internet

This blog hosted by:
http://blogs.vbcity.com
  Home :: Syndication  :: Login   Community Forums   :: vbCity.com   :: DevCity.NET  

OK - before make yourself a cup of tea, break open the Butter Thins and settle down to read this blog - I must warn you that this blog is technical in its nature.  If you are expecting lighthearted romance or a thrilling roof top chase - you've come to the wrong place...

If you were to bracket me as a specific kind of person, I would say that panicker would be pretty much last on your list.  If say, the building I work in were about to blow up, I wouldn't freak out and start jumping out of windows or try to make the Secretary feel like a woman in her last moments (i.e. could you iron this?).  I would calmly get my coat, maybe roll a cigarette and stroll outside whilst determining what pub to visit before the police interviews start.

Therefore, when problems start on my computer I generally take my time, research the problem before issuing Fatwa’s on all Microsoft Employees.  Now this particular problem has been plaguing me for over two months and this blog at the very least will serve as some record, and hopefully, resource for other developers who find themselves with similar symptoms.

The Problem

Whilst working on one of my VB.Net projects, I noticed that the background compiler would occasionally freak out and start reporting errors on non-existent problems.  An example of this would be losing method and variable declarations, e.g. in the following screenshot, there are entries indicating that 'cSkinBut' is not declared where it quite obviously is...

http://www.vbcity.com/forums/attachment.asp?id=8868

Another example is the following where it is claiming that 'lblDisUnlockKey' is not declared...

http://www.markdryden.co.uk/vs2003.jpg

Now these errors would appear sporadically, e.g. you could be working quiet nicely away when all of a sudden 400 or so of these bogus errors occur.  However, keeping in the code view of class and form elements would reduce the frequency of the errors.

Other problems - which I believe is related to this issue include...

Reporting controls as missing (but appending an underscore to the control name) and indicating that the error is occurring at line 16,000,000 + (http://www.vbcity.com/forums/attachment.asp?id=9821)
Unable to Override methods from an abstract class (a base set as MustInherit with methods declared as MustOverride)

Now to get rid of this error you could do one of two things.  One, close the solution and reopen it.  Here the various errors will disappear and the solution can be built and ran without any problems at all.  Two, goto the variable / method declaration and amend it, e.g. rename the declaration and set it back again or change the access level.  [Admittedly, not very practical for 400+ errors]

Emulating the Problem

Ah - this has probably been one of the hardest things to do - in fact, I couldn't manage it.  It just seemed to happen with these two solutions and ignore others.  However, the common attributes of these two solutions were...

  • Using Form Inheritance
  • Using class based data access
  • Included two or more projects
  • Included inherited controls

The Solution

Now I won't bother you with the various newsgroup postings I made nor to'ing and fro'ing with Microsoft - however, the solution was pointed out to me by Spebby a member on VBCity.  It seems that this was a known issue with Visual Studio 2003 - however, as it seems MS policy not to issue a Service Pack for VS 2003 but supply Hotfixes on a reactive basis.  The hotfix can be found here ( http://support.microsoft.com/kb/822690 ) and can only be requested from MS directly.

HTH - Drydo

Note 1: the article mentions that this error occurs in project with over 100k lines of code, however, the two offending projects I had that had this error were 6k and 20k lines of code.
Note 2: interesting though that the Knowledge Base Article hasn't been indexed by Google or another any other major Search Engine (at the time of writing).

posted on Friday, November 19, 2004 12:17 PM