Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

TaskCanceledException raised by RemoteNavigationManager in Blazor Server app

$
0
0

I have a Blazor Server app which creates a zip file in memory and delivers that zip file via an call to a get method of an controller. I use following call inside of a button to start the download:

navigationManager.NavigateTo($"api/DownloadFile?RequestGuid={WebUtility.UrlEncode(RequestGuid.ToString())}", true);

Everything works fine, but 1 or 2 minutes after the successfull download the application crashs with following error:

Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager[4]Navigation failed when changing the location to api/DownloadFile?RequestGuid=db296363-ec46-4661-a8f5-78f9537114bcSystem.Threading.Tasks.TaskCanceledException: A task was canceled.at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntimejsRuntime, String identifier, Object[] args)at Microsoft.AspNetCore.Components.Server.Circuits.RemoteNavigationManager.<>c__DisplayClass13_0.<g__PerformNavigationAsync|0>d.MoveNext()

Is there any workaround on how to avoid this issue?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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