Random Compiler Errors, again

J

jon morgan

OK, I'm going to be brave. There is a bug in VS.Net 1.1 that causes random
compiler errors.

I have raised this issue in posts at least three time in the past couple of
months without attracting much interest. But it's driving me nuts. Here's
what happens. I'm working on a multi project VB app. happily writing nice
inoffensive code - go to compile and the compiler tells me there's a problem
in a project I'm not working on. But really there isn't - I can simply exit
VS and boot in again immediately and bingo, the compiler errors are gone and
all is well again for a while. After some time I get a different error or
maybe the same one and so it goes on.

It's very obvious what causes the compiler this angst: for some reason it
convinces itself that one or two lines of code are missing - could be a
field, and event definition, a method title whatever. But really the code is
there fine all the time - if I delete it and immediately reinstate it the
compiler now "sees" the code and the errors disappear. Weird or what ...

I'm quite prepared to believe that this is all down to my aggressive coding
style but surely I can't be the first person to have experienced this. So
come on MS wizzos - what's happening...

Your help is appreciated

Jon
 
C

Charles Law

Hi Jon

You are right. There is a bug in VS.NET.

The most common way that I have encountered this is, in a multi-project
solution, where references between the projects are made by browsing to the
output dll as opposed to selecting it from the Projects tab.

Apparently, VS.NET gets 'confused' by the existence of both a dll and
project by the same name. I spent some weeks going through this with MS
whereupon they admitted that this was an issue. Their recommendation was to
always add references from the Projects tab.

HTH

Charles
 
J

jon morgan

Thanks for getting the debate going Charles.

I usually keep all the relevant projects together in the solution rather
than use dll references. Otherwise I just get tied up in knots trying to
remember which project holds what references. That way, I think VS does a
very good job of keeping things in sync and I'm not surprised MS recommend
it.

However did you get the same symptoms compiler error symptoms as I reported:
ie apparently missing lines of code causing compiler errors when the code is
really there ?

Jon
 
C

Charles Law

That was certainly one of the symptoms. A line of code would be underlined
as having an error, where the error might have been that function signatures
did not match, when they clearly did. I would close VS, delete the bin and
obj directories of all the projects and restart. The problem would go away
until a while later when some innocuous change would cause it again, or a
similar problem. The supposed error was always unrelated to the change.

Incidentally, I also got problems that I believe were caused by VBCommenter.
From time to time, I would build only to find that there were dozens of
errors. They were caused by code fragments being dumped at the end of files.
I would delete them and the problems went away. I now steer clear of
third-party add-ins, especially free ones!

Actually, now I read the symptoms you are experiencing again, perhaps mine
were not exactly the same. I don't think that I ever had problems where I
could remove an offending line, paste it back in and the problem would go
away. I did, however, get symptoms where it looked like the compiler could
not locate some code, i.e. it complained that something was not defined, but
I had to use the technique above to get it to right itself.

Charles
 
J

jon morgan

Thanks Charles - our experiences do seem pretty similar although the action
you took to remedy it was more drastic: maybe your errors would have
disappeared as well if you had simply closed then re-opened VS. Either way
the clear conclusion does seem to be the the VS.Net 1.1 compiler does
generate random errors.

The question is what to do about it because this post is clearly not
attracting MS or MSVP interest. Always difficult of course to prove a bug
when it can't be reproduced by third parties.

How did you get MS' attention ? My experience with their help lines reminded
me of the old days when IBM ruled the land. Basically you got a pat on the
head and a lot of beareaucratic woffle and that was it. Obviously you were
more persistent.

Jon
 
C

Charles Law

I submitted a support request via their web site. The form asked for my
product s/n and they did the rest. In terms of response to the initial
request I was very impressed.

In fact, I have submitted several support requests this way and every one
has been responded to promptly, and everyone resulted in a resolution to my
satisfaction (makes me sound like a company man). In one case, they produced
a special build of mshtml.dll to resolve a bug.

In this particular case here, it took some time, but only because they
explored all the possible avenues thoroughly before concluding that it was
indeed caused by a known problem. I had a three-way conference with someone
in Europe and someone in the states using MS Office Live Meeting so that
everyone could see what was happening, live, on my PC. I reproduced the
problem, and saw it go away when I changed my references from dll references
to project references.

I have to say that I have been very happy with the support, but I know it
hasn't always been that way.

Give the on-line support a try; it worked for me.

Good luck.

Charles
 
J

jon morgan

Thanks Charles - I'll give it a try. Did they produce a patch to fix our
problem or were you just told "OK - it's a bug we'll fix it for the next
release " ?

Jon
 
C

Charles Law

No patch. Once a workaround had been established I settled for that, and it
was taken as read that the problem would be sorted out for the next release.
By that, I expect it to be sorted in VS 2005, although it may be that there
are other differences that mean that the same problem couldn't occur anyway.

The way things are going, I can't see MS releasing an update to VS 2003 or
the Framework 1.1 before the full release of Whidbey, much as many people
here and elsewhere have been crying out for one. There seem to be enough
problems to make it worth it from the developer's point of view, but it may
not be cost-effective for MS.

We shall see. Hopefully I have spoken too soon ;-)

Charles
 
J

jon morgan

I'm sure you're right Charles, but you've reminded me that the Whidbey beta
is knocking around so I think I'll check that out first. It's very unlikely
as you say that MS will release a patch to 1.1 at this stage. Ho,hum. Well
thanks for the chat. Maybe it will console/enlighten others..

Best regards

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top