BUG: Incorrect Exit Code Displayed in Output Window When Application Run Under Debugger (320165)
The information in this article applies to:
- Microsoft Visual C# .NET (2002)
- Microsoft Visual C# .NET (2003)
This article was previously published under Q320165 SYMPTOMS Incorrect process exit code may be displayed in the Output
window when you run an application under the managed debugger. RESOLUTION Do not use the debugger Output window to obtain the exit
status of an application. Run the application from a batch file to obtain the
return value, as follows:
REM Exit_Error.bat
@echo off
ConsoleApplication1.exe
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 echo Exit Value 2
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 echo Exit Value 1
IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 echo Exit Value 0
IF ERRORLEVEL -1 IF NOT ERRORLEVEL 0 echo Exit Value -1
STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
REFERENCESFor additional information about testing
ERRORLEVELs, click the article number below to view the article in the
Microsoft Knowledge Base: 39585 Correct Testing Precedence of Batch File ERRORLEVELs
Modification Type: | Minor | Last Reviewed: | 5/28/2003 |
---|
Keywords: | kbbug KB320165 |
---|
|