Application.StartTask() - action may not run in versions higher than 2.2.29

0
0

Wisej team,

 

The following code example is working fine in v2.2.29 and below, but the action inside Application.StartTask() is never run in higher versions (including 2.2.38-rc)

 

var a = Task.Run(async () =>
{
await Application.StartTask(() =>
{
var x = “Working in 2.2.29 but not in higher versions, including 2.2.38-rc”;
}).ConfigureAwait(false);
}).ConfigureAwait(false);
a.GetAwaiter().GetResult();

 

 

Please advise in what version it is expected to be fixed.

  • You must to post comments
0
0

The code snippet works without issues. You need to send a small test case showing what it is that you trying to do with a task inside a task.

  • You must to post comments
0
0

Luca,

The issue still exists in v2.2.39. Please fix asap

 

private void CbValue_DropDown(object sender, EventArgs e) // or any event basically
{

var a = Task.Run(async () =>
{
await Application.StartTask(() =>
{
var x = “Working in 2.2.29 but not in higher versions, including 2.2.39”; // !!
}).ConfigureAwait(false);
}).ConfigureAwait(false);
a.GetAwaiter().GetResult();

}

  • You must to post comments
0
0

I cannot reproduce. Tried to copy the code above and runs. The only issue is that since you are starting a task first and then another task when the first runs you are losing the Wisej context. But nothing changed in that respect. Task.Run() loses the context. Application.StartTask() doesn’t. You should always use Application.StartTask() if you want to preserve the context and be able to push-update the page.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.