Noich
Noich

Reputation: 15441

C#/.Net launched process with exit code -2146234327

I have a C# 4 application which launches another one to execute some Python code. The Python code can be executed with no problems (checked on PythonWin).
In my app I see that the exit code is -2146234327. I've been Googling and couldn't figure out what does it mean.
Any ideas?
Thanks

Upvotes: 5

Views: 2499

Answers (2)

Antony Cooke
Antony Cooke

Reputation: 11

I’ve written a workaround based on the fact that this is a warning rather than an error.

I have included the following in the DOS Batch file that runs Analyse and Index Rebuild processes for ArcGIS

set myRC=%ERRORLEVEL%
echo %myRC%
set Constant=-2146234327
echo %Constant%
if %myRC% EQU %Constant% set ERRORLEVEL=0
echo %ERRORLEVEL%
  • Line 1 sets a variable to the value returned from the call command e.g. call D:\Python27\ArcGIS10.2\python.exe D:\Analyze\Analyze.py >> D:\Analyze\Log\output.txt
  • Line 2 echoes the value returned
  • Line 3 sets a constant variable
  • Line 4 echoes this out
  • Line 5 compares the value returned from the CALL command against the constant and sets the ERRORLEVEL variable to zero if they match
  • Line 6 echoes out the return Code.

Found this information elsewhere that may shed a little more light on the issue:

https://github.com/ucd-cws/arcpy_metadata/issues/13

Upvotes: 1

Roman Ryltsov
Roman Ryltsov

Reputation: 69632

-2146234327 is HRESULT code, typically looked for in hex. See Interpreting HRESULTS returned from .NET/CLR: 0x8013XXXX:

HOST_E_EXITPROCESS_TIMEOUT 0x80131029 Process exited due to Timeout escalation.

Upvotes: 6

Related Questions