.net application failing when fired via scheduled task

前端 未结 4 1814
失恋的感觉
失恋的感觉 2021-02-04 15:42

I have a .net console application written in c# which does exactly what it should when run inside visual studio and when clicking the .exe file in the file system. It runs like

相关标签:
4条回答
  • 2021-02-04 16:31

    It seems like a permissions issue to me. Running the code inside VS is way too different to running it on its own. VS takes care of most of the stuff and makes life easy for the developer.

    Can you please check if the account you are using to run the scheduled task has permission to access the network path?

    0 讨论(0)
  • 2021-02-04 16:35

    You should grant to the specified user access to COM automation factory:

    • 1) Start->Run->dcomcnfg
    • 2) Component Services->Computers->My Computer
    • 3) Right-click My Computer, Properties
    • 4) COM Security tab, Launch and Activation Permissions, Edit Default
    • 5) Add all access rights for the specified user, you are using to run scheduled task.
    0 讨论(0)
  • 2021-02-04 16:38

    Faced with similiar problem, when application normally is worked as expected, but when i run it from the scheduled task, it's immediately closing, and throws an error: "File path not found ...".

    Fixed it with setting scheduled task action parameter:

    Start In (optional): c:\my application\executable folder path

    0 讨论(0)
  • 2021-02-04 16:43

    The first of all, take a look on this http://support.microsoft.com/?id=257757

    You can try few things:

    • Run you task under real user account (make sure this account has access to network path)
    • 'Ogawa Hack', as mentioned here http://social.msdn.microsoft.com/Forums/en-US/b81a3c4e-62db-488b-af06-44421818ef91/excel-2007-automation-on-top-of-a-windows-server-2008-x64 create desktop folder for system account C:\Windows\SysWOW64\config\systemprofile\Desktop (or \System32\ if your system is 32x)
    0 讨论(0)
提交回复
热议问题