Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


ErikC
  •  ErikC
  • Free support Topic Starter
2015-11-12T11:15:34Z
Hi,

Today I used the .NET task to write some nifty code 😎 and wanted to exit my method at some point using an errorlevel.
Normaly I use the Environment.Exit(-1) to exit my app with an error, so I did in the .NET task.

Guess what happened? The Visualcron service stopped 😢 instead of exiting my method.

I could start the service again and connect to it using the client, but I would recommend people not to use this function if you still want to use Visualcron.

Regards,
Erik
Uses Visualcron since 2006.
Sponsor
Forum information
thomas
2015-11-12T12:01:09Z
I have never used Environment.Exit, but isn't that a pretty brutal way of ending the application? Isn't it better to return int or throw an exception?

Thomas
Support
2015-11-12T14:43:49Z
Environment.Exit is stopping the hosting process and as VisualCron is executing your .NET code you will exit that application. I suggest you throw an exception instead.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
  •  ErikC
  • Free support Topic Starter
2015-11-13T14:37:01Z
I'll change (already did) my code to prevent this from happening again. An Exception is a good solution.

Regards,
Erik
Uses Visualcron since 2006.
Scroll to Top