Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Commented Unassigned: ClearScript, C# and Scheduler [103]

$
0
0
Context: Azure, C#, ClearScript.V8.5.4.5

I have a number of C# programs running under the scheduler in an Azure VM. All but two are currently working due to an error which identifies itself by a last run result of 0xE0434352.

In Event Viewer -> Windows Logs -> Application there are a number of errors listed, all of which say mostly the same as the following

```
Application: NormanEmailHandler.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ComponentModel.Win32Exception at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D) at MS.Win32.HwndWrapper..ctor(Int32, Int32, Int32, Int32, Int32, Int32, Int32, System.String, IntPtr, MS.Win32.HwndWrapperHook[]) at System.Windows.Threading.Dispatcher..ctor() at System.Windows.Threading.Dispatcher.get_CurrentDispatcher() at Microsoft.ClearScript.Windows.WindowsScriptEngine..ctor(System.String, System.String, Microsoft.ClearScript.Windows.WindowsScriptEngineFlags) at Microsoft.ClearScript.Windows.JScriptEngine..ctor(System.String, System.String, Microsoft.ClearScript.Windows.WindowsScriptEngineFlags) at Microsoft.ClearScript.Windows.JScriptEngine..ctor(Microsoft.ClearScript.Windows.WindowsScriptEngineFlags) at NormanEmailHandler.Program..cctor() Exception Info: System.TypeInitializationException at NormanEmailHandler.Program.Main(System.String[])
```

I have looked at and tried the code samples at [AppDomain.UnhandledException Event](https://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.71).aspx) however the EXE fails before that code gets executed, even when it's the first thing encountered in the Main().

It does occur to me as I write this that instantiating the object before Main() kicks in might have something to do with the exception handler not firing. What's be nice, though would be to know why I'm having the problem at all.

```
namespace NormanEmailHandler
{
class Program
{
static JScriptEngine JSengine = new JScriptEngine(WindowsScriptEngineFlags.EnableDebugging | WindowsScriptEngineFlags.EnableJITDebugging);

```

Comments: > the problem might be that your scheduled task has no access to an interactive desktop, which is a requirement for Windows script engines such as JScript. In the original [MSScriptControl](https://msdn.microsoft.com/en-us/library/aa227400(v=vs.60).aspx) a property could be set to false to cause scripts not to require a UI (well, that's how I'm reading it at the moment), viz > AllowUI When set to True, means that the script program can display user interface (UI) elements such as a MsgBox Setting it to False is what I'm assuming would remove the UI requirement. I had hoped that perhaps there was a similar property available in the ClearScript engine. There isn't so I'd better try something else. AND find out what the native error code is.

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images