Link to home
Start Free TrialLog in
Avatar of CJSantora
CJSantora

asked on

Program will not run as scheduled event

I have a program that parses several files and writes them to an MS SQL database. I have insert debug statements everywhere at  this point to try to determine the problem, but with no luck. When I run the program on the server, it runs perfectly. I then schedule the program to run using windows scheduler and it fails everytime. It is currently located in the c:\Winnt\ directory, and it is an .exe program. the error I receive is as follows, I woiuld appreciate any help.:



The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: .NET Runtime version 1.1.4322.2032- ParseInventory.exe - Common Language Runtime Debugging Services: Application has generated an exception that could not be handled.

Process id=0x1394 (5012), Thread id=0x1348 (4936).

Click OK to terminate the application.
Click CANCEL to debug the application..
Avatar of ryerras
ryerras

This article should help you out. Pay attention to DCOM settings configurations

http://support.microsoft.com/default.aspx?scid=kb;en-us;833977&Product=vsnet#3a
Avatar of CJSantora

ASKER

Here is some additional debugging if it helps anyone with this problem:

An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll

Additional information: Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
Hmm. It is certainly some permissions issue. Configure the permission according to your situation


(1) Open "Control Panel".
(2) Open the "Administrative Tools" folder.
(3) Double-click "Microsoft .NET Framework Configuration".
(4) There you must change the "Runtime Security Policy" if you want to

When you scedule a task to run it will be executed as the local system account

This means you wont be able to access network shares or use integrated security to connect o the DB...

Hope this helps
P.s.:

Of course you can also configure who is executing the task... But this depends on the OS you use..
This is definitely a problem, the script needs to access network shares, is there a solution to this.
Yes

You can define under which account the task gets started. Reightclick on the task under XP and goto its properties. There should be a user account. If you dont use XP i think you need to change the account which the tasksceduler is running.

Also use UNC names and not mapped drive letters when you try to access the files
ASKER CERTIFIED SOLUTION
Avatar of ajitanand
ajitanand

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your sggestion, that seems to have resolve dthe problem.
CJSantora
What was wrong with my answers?