Error in Exec Running node.js

Asked 2 years ago, Updated 2 years ago, 82 views

Thank you for your help.
If you try to run the exe file on the C# module using exec(Sync) in node.js,
The following error will be printed on the console:

Exception.ToString() failed to display the exception string.

If you run exe directly on cmd without using node, it will be successful.

As a result of our investigation,
Using Console.SetCursorPosition on C# I have encountered the above problem, but I am not sure what caused it.

If you know, please tell me the cause and how to avoid it.

c# node.js

2022-09-30 13:54

1 Answers

The Console.SetCursorPosition method throws IOException when the console does not exist.This may include "Build as a Windows Application", but this is probably the case when booted from node.js, where IOException is thrown and Exception.ToString() fails when outputting the error.

Therefore, wouldn't it be better to use the command line arguments to control whether or not to operate the Console?


2022-09-30 13:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.