Jon
Wed Mar 30 11:53:35 CST 2005
Uri Dor <tablul@newsgroups.nospam> wrote:
> try running this C# code in VS.NET 2003:
>
> using System;
>
> namespace ExitCode
> {
> class MainClass
> {
> static int Main(string[] args)
> {
> return 7;
> }
> }
> }
>
> run it under the debugger, and what do you get?
> The program '[4552] ExitCode.exe' has exited with code 0 (0x0).
>
> see? zero, not seven. Is this a bug or what?
I suspect it's a limitation of the debugger. It happens to me too, just
so you know you're not going mad :)
My guess is that the debugger is intercepting things, and resetting the
exit code to show that *it* exited cleanly. Not terribly helpful though
:(
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too