My C# application is returning 0xE0434352 to Windo

2020-01-24 20:29发布

I have written a few C# apps that I have running via windows task scheduler. They are running successfully (as I can see from the log files that they are writing ) but windows task scheduler shows them returning a last run result of 0xE0434352. Is there something I need to do in my C# application so that it returns a success code to the windows task scheduler?

9条回答
祖国的老花朵
2楼-- · 2020-01-24 20:58

Hans Passant was correct, I added a handler for AppDomain.CurrentDomain.UnhandledException as described here http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.71).aspx I was able to find the exception that was occurring and corrected it.

查看更多
Melony?
3楼-- · 2020-01-24 21:00

I had this issue and it was due to the .Net framework version. I had upgraded the build to framework 4.0 but this seemed to affect some comms dlls the application was using. I rolled back to framework 3.5 and it worked fine.

查看更多
看我几分像从前
4楼-- · 2020-01-24 21:01

In case it helps others, I got this error when the service the task was running at didn't have write permission to the executable location. It was attempting to write a log file there.

查看更多
劫难
5楼-- · 2020-01-24 21:02

I was referencing a mapped drive and I found that the mapped drives are not always available to the user account that is running the scheduled task so I used \\IPADDRESS instead of MAPDRIVELETTER: and I am up and running.

查看更多
可以哭但决不认输i
6楼-- · 2020-01-24 21:06

When setup a job in new windows you have two fields "program/script" and "Start in(Optional)". Put program name in first and program location in second. If you will not do that and your program start not in directory with exe, it will not find files that are located in it.

查看更多
贼婆χ
7楼-- · 2020-01-24 21:07

It is permission issue in my case the task scheduler has a user which doesn't have permission on the server in which the database is present.

查看更多
登录 后发表回答