>I am intermittently getting the following compiler error:
>
[quoted text clipped - 8 lines]
> else
> to look for.
I don't know. I'm glad *I'm* not seeing that error...sounds like a doozy to
figure out. :)
Seriously though, is there something unusual about your computer, like
overclocking or multiple CPUs or something like that? It might be related
to something the compiler does only in certain situations (ie odd hardware
configuration), which might explain why the error isn't more commonly known.
As far as what's specifically going wrong, Google suggests that the "Cannot
change thread mode after it is set" is something that happens when some COM
code misbehaves. Microsoft's KB article 824480 indicates that one might get
the error when COM hasn't been initialized yet when the CRT startup code is
called. They have a fix, but of course since the error seems to be
happening within the compiler itself, you don't have any way to apply the
fix.
As a last-ditch attempt to fix it, you might try reinstalling Visual Studio.
That's what the docs say you should do for error CS2000. Of course, I'm
sure they say that only because CS2000 is a generic "something failed" error
and that's the best advice they can offer. But you never know...could be
worth a try. :)
Sorry...I wrote a whole post and really all I can say is "I have no idea".
I admit, that's not very useful. My bad. :)
Pete
Pat,
>I am intermittently getting the following compiler error:
> CSC : fatal error CS2000: Compiler initialization failed unexpectedly --
> 'Cannot change thread mode after it is set. '
Seems like you've hit an uncommon error message with the C# compiler. For us
to better help you in solving the issue, we'd need information at least
about the following:
- Are you using Visual Studio to compiler or the command-line C# compiler
directly?
- If Visual Studio, which version and which service pack, if any?
- If csc.exe, which version? Is it 1.1 or 2.0?
- Which operating system are you using? If Vista, which beta/build?
- Can you compile any applications, or is the one you are referring to the
only one to cause trouble?
- Have you tried to compile the simplest possible Hello World application?
By answering these questions we would get a better picture of your
situation.
Thanks!

Signature
Regards,
Mr. Jani Järvinen
C# MVP
Helsinki, Finland
janij@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Pat - 15 Nov 2006 06:43 GMT
I am using
Visual Studio 2005
.NET 2.0 (same for csc.exe)
OS: Win XP Professional SP2
Error usually manifests first when accessing web service. After that it
occurs when try to compile any other project via command and some times using
IDE.
I am able to compile and run all the programs. This error happens
intermittently and usually happens when accessing web service (which does JIT
compiling).
I have two web applications using different versions of .NET. I had my
suspicions on this but we have several machines with these webapps running
without any problems.
Thanks for your response.
Pat
> Pat,
>
[quoted text clipped - 19 lines]
>
> Thanks!