Click to See Complete Forum and Search --> : running c# app remotely from sql server sp


dky1e
April 4th, 2003, 02:32 PM
I'm getting an error when i try to run a c# application from a sql server procedure.

It runs with out a problem when i run the app by double clicking. It just errors out when im attempting to run it with xp_cmdshell.

Any ideas?


Here's part of the exception that im getting:
Unhandled Exception: System.TypeInitializationException: The type initializer for "System.Drawing.SafeNativeMethods" threw an exception. ---> System.Runtime.InteropServices.ExternalException: Failed to create system events window thread.

gjs368
April 4th, 2003, 02:40 PM
I ran into the exact same issue myself yesterday; I discovered that xp_cmdshell would not let me run any app that had a GUI, but I can run a console app just fine.

dky1e
April 4th, 2003, 03:07 PM
That fixed it... it's just annoying that the whole app didn't run just because it couldn't draw the form. I guess i should have caught the exception and ignored it....

Thanks!

pareshgh
April 7th, 2003, 11:30 AM
yes, its better to use messagebox with exceptions or console write. since they are the most usefull stuffs with debuging exceptions.

Paresh