Quantcast
Viewing all articles
Browse latest Browse all 2206

Commented Unassigned: Windows 2008 R2 Server - unhandled exception [12432]

TaskEditDialog ted = new TaskEditDialog(dct, true, true);
try
{

ted.ShowDialog();


On Windows 2008 R2 Server, logged in as an Administrator, when the ShowDialog() call exits (but before it hits the next line of my code) I am seeing an Unhandled Exception.

On my Windows 10 dev machine it is absolutely fine, on other platforms it also seems fine. It is the specific circumstances that seems to be causing the problem.

Any advice most welcomed. If I can provide more/better diagnostic information I'd be very happy to.
Comments: ** Comment from web user: DonAtVega **

Here's the task creation code.

```

public static Microsoft.Win32.TaskScheduler.Task CreateDataCommunicatorTask()
{
TaskService tsmgr = new TaskService();

Microsoft.Win32.TaskScheduler.Task dct = tsmgr.GetTask(strings.DataCommunicator2Task);

if (dct == null)
{
string strThisProgram = Assembly.GetEntryAssembly().CodeBase.ToString();
strThisProgram = strThisProgram.Replace(@"file:///", @"");
strThisProgram = strThisProgram.Replace('/', '\\');

TaskDefinition td = tsmgr.NewTask();

td.RegistrationInfo.Description = strings.ExecuteTheDataCommunicator;


TimeTrigger tg = new TimeTrigger(DateTime.Now.AddHours(2));
tg.Repetition.Interval = TimeSpan.FromMinutes(5);

td.Triggers.Add(tg);
td.Actions.Add(strThisProgram);

try
{
tsmgr.RootFolder.RegisterTaskDefinition(strings.DataCommunicator2Task, td);
dct = tsmgr.GetTask(strings.DataCommunicator2Task);
}
catch
{
MessageBox.Show(strings.CouldNotCreateDataCommunicatorTask);
dct = null;
}

}

return dct;
}
```


Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>