Random Compiler Errors

  • Thread starter Thread starter jon morgan
  • Start date Start date
J

jon morgan

Hi,

I get random errors raised when compiling a multi-project application. For
example the compiler will claim that a class has no constructor when it
does. If I replace the first line of the constructor with the same code ( or
just re-load VS) and then recompile things are OK for a while but then the
spurious error comes back. The same sort of random behaviour can occur
anywhere in my app. - basically the compiler doesn't "see" a line of code.

Has anyone else experienced this irritating behaviour ? I'm using framework
v1.1

Thanks for any help.

Jon
 
The next time I would do an hexadecimal dump of this portion of code. My
though is that the source file contains some special character that is not
handled by the compiler...
 
Thanks Patrice - I tried that with Winhex. There's nothing wrong with the
lines the compiler zaps. And remember it doesn't always zap the same lines.
This is a genuinely random error that
can occur anywhere in my code although on reflection it does tend to be the
first line of a member that's zapped.

Jon
 
I have seen this before. Open Configuration Manager and make sure the Build
checkbox is checked for all projects. I have seen these get unchecked for no
apparent reason.
 
Thanks but , again, I just don't think this is the answer. I haven't noticed
any erratic behaviour in the build pattern - at one stage I was over 30
projects and they were all getting built. I've now rationalised down to 10
but it hasn't affected the random compiler behaviour.

Jon
 
I gather from you reply that all the projects have the Build checkboxs
checked. Are any of the assemblies installed in the GAC? If so, it is
possible that the complier is looking at the GAC version instead of your
code. The next time it happens, try rebuilding the assemblies (without
changing any code) and then try running it again.
 
Thanks, but no I don't have any of my assemblies GACed. Again just to repeat
an example: I do some work in one project, and go to rebuild my solution.
The compiler tells me that a class in a different project in the solution
does not have a constructor. If I delete the first line of the constructor
and re-instate it the compiler error disappears. Alternatively if I exit and
reboot VS and all is well.

Weird or what ...
 
Back
Top