Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Blazor Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation错误,会发生什么情况?_Blazor_Amcharts4 - Fatal编程技术网

Blazor Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation错误,会发生什么情况?

Blazor Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation错误,会发生什么情况?,blazor,amcharts4,Blazor,Amcharts4,我们在使用Blazor和AmChart4方面都是新手。 我们每隔几秒钟就向系列中添加一次数据,我们希望让应用程序运行几个小时 通常在运行几个小时后,我们会出现以下异常: 一项任务被取消。在Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](字符串标识符,对象[]args) 位于Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRunti

我们在使用Blazor和AmChart4方面都是新手。 我们每隔几秒钟就向系列中添加一次数据,我们希望让应用程序运行几个小时

通常在运行几个小时后,我们会出现以下异常:

一项任务被取消。在Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](字符串标识符,对象[]args) 位于Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime,字符串标识符,对象[]args) 在D:\ProgettiBlazor\amCharts\u V3\amCharts\Pages\Index.CountDownTimer(对象源,ElapsedEventArgs e)中的amCharts.Pages.Index.CountDownTimer处:第97行

有人对如何预防这个问题有什么建议吗

在File.blazor中,有一个线程每5秒运行一次,调用此函数: '''

''' 根据文件js,我们有:

''' 函数AggiungiPunti_Random(){

} '''

其中generate data random创建了一个带有日期和少量值的对象

public async void CountDownTimer(Object source, System.Timers.ElapsedEventArgs e)

{
    try

    {
        counter += 1;

        writeLog(string.Format("CountDownTimer {0} ", counter));

        await JS.InvokeVoidAsync("AggiungiPunti_Random");

        await InvokeAsync(StateHasChanged);

    }

    catch (Exception ex)

    {
        writeLog(string.Format("CountDownTimer - eccezione: {0} {1}", ex.Message, ex.StackTrace));

    }
}
am4core.ready(function () {

    var dati = generateChartData_Random(new Date());

    chart.addData(dati);

});