Is there any known reason this might happen? Everything works on Windows 7.
I've updated to the latest Excel DNA release (NuGet packages are version 0.34.6) with no luck.
Here is how I am using the ExcelAsyncUtil.Observe call from my Excel DNA function:
var result = ExcelAsyncUtil.Observe("QRDE", new[] { referenceString, functionName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20 }, delegate
{
Func<CancellationToken, Task<object>> taskSource =
token => PTXLAsync(caller, functionName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14,
arg15, arg16, arg17, arg18, arg19, arg20, token);
var cts = new CancellationTokenSource();
cancellationTokens.AddTokenSource(cts);
var task = taskSource(cts.Token);
return new ExcelObservable<object>(task.ToObservable());
});
The above is after updating my code to instantiate an ExcelObservable - here is how the code was previously using an older version of sample code (same result - Dispose is not called).
var result = ExcelAsyncUtil.Observe("QRDE", new[] { referenceString, functionName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9,
arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20 }, delegate
{
Func<CancellationToken, Task<object>> taskSource =
token => PTXLAsync(caller, functionName, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14,
arg15, arg16, arg17, arg18, arg19, arg20, token);
var cts = new CancellationTokenSource();
cancellationTokens.AddTokenSource(cts);
var task = taskSource(cts.Token);
return new ExcelTaskUtil.ExcelTaskObservable<object>(task, cts);
});
I need dispose to be called so the cancellation token source is cancelled. I have logic that keeps track of pending operations and this is how I know what is pending. For more info this is never running:
In CancellationDisposable:
public void Dispose()
{
cts.Cancel();
}
Thanks,
Damon Carr