A lot of web exceptions at runtime even in arcgis-runtime-samples-dotnet-master project

1607
7
03-15-2018 09:03 AM
Jean-ChristopheBertolini
New Contributor III

Hi,

I am using the runtime 100.2.1 for .net with Visual Studio 2017 and my project and even in the sample projects I got a lot exceptions  :

I don't understand. What's happen ?

Thanks

ArcGISRuntime loaded x64 Path: C:\arcgis-runtime-samples-dotnet-master\output\WPF\debug

Exception levée : 'System.Net.Http.HttpRequestException' dans System.Net.Http.dll
Exception levée : 'System.Net.WebException' dans System.dll
Exception levée : 'System.Net.WebException' dans System.dll
Exception levée : 'System.ObjectDisposedException' dans System.dll
Exception levée : 'System.Net.WebException' dans System.dll
Exception levée : 'System.Net.WebException' dans System.dll
Exception levée : 'System.ObjectDisposedException' dans System.dll
Exception levée : 'System.Net.WebException' dans System.dll
...

Exception levée : 'System.Net.WebException' dans System.dll
Exception levée : 'System.Net.WebException' dans System.dll
..
Exception levée : 'System.Net.WebException' dans System.dll
Exception levée : 'System.Net.WebException' dans System.dll
Exception levée : 'System.OperationCanceledException' dans Esri.ArcGISRuntime.dll
Exception levée : 'System.OperationCanceledException' dans mscorlib.dll
Exception levée : 'System.OperationCanceledException' dans mscorlib.dll
Exception levée : 'System.OperationCanceledException' dans mscorlib.dll
Exception levée : 'System.OperationCanceledException' dans mscorlib.dll

...

Exception levée : 'System.Threading.Tasks.TaskCanceledException' dans ArcGISRuntime.WPF.Samples.dll
Exception levée : 'System.Threading.Tasks.TaskCanceledException' dans mscorlib.dll
Exception levée : 'System.Threading.Tasks.TaskCanceledException' dans mscorlib.dll
Exception levée : 'System.Threading.Tasks.TaskCanceledException' dans mscorlib.dll

-----------------------------------------------------------

03/16/2018

I made some investigations and I have the same problem just running the ArcGIS Runtime project template.
I have try to reinstall visx, change machine, switch network private to public)... I am stuck. Any ideas ?
Thanks

-------------------------------------------------------------

03/21

I continue my investigations and notice that if I going down to the Runtime 100.0 all exceptions no longer appear.

So something have change between the versions.

Can somebody reproduce this or it is a problem in my environment ?

Thanks.

7 Replies
dotMorten_esri
Esri Frequent Contributor

This is just the behavior of the HTML stack. When you zoom and pan, we start requesting data to render the map, but if you zoom or pan really fast, the data we requested might no longer be needed and therefore gets cancelled. That throws this first-chance-exception, which is expected and is nothing to worry about.

In earlier releases we didn't cancel if the debugger was attached so you wouldn't see all these messages (in an attempt to avoid forum posts like this) - however that had the downside of making the map update really slow when debugging (the cancellation behavior was however still happening when you weren't debugging - you just wouldn't see it).

0 Kudos
BryanRoth
New Contributor

Trying to evaluate the .NET SDK and I'm seeing the same issue as the OP with 100.4.0:

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Net.Http.dll
Exception thrown: 'System.OperationCanceledException' in System.Net.Http.dll
Exception thrown: 'System.OperationCanceledException' in System.Net.Http.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll

Map updates are horribly slow as well. It's so slow it's unusable. I've noted that the assembly where the throw has originated has changed but the explanation is likely the same.  I't would seem that I'm not experiencing either of the benefits you mention (performance/lack of exceptions).

Any reason the API doesn't wait for the user to finish zoom/pan before submitting the request to "filter" it down a bit rather than making so many requests? It seems like every UI event is generating a request rather than starting a timer to de-bounce the request.

0 Kudos
dotMorten_esri
Esri Frequent Contributor

Map updates are horribly slow as well. It's so slow it's unusable

You should only see the slow performance with the debugger attached. It will not affect apps running in production. The cause is the Visual Studio debugger logging these synchronously.

Any reason the API doesn't wait for the user to finish zoom/pan before submitting the request to "filter" it down a bit rather than making so many requests?

Performance. We have chosen to optimize for the best production-performance, and sacrifice debugging performance. While we have tried quite a few approaches to prevent this (including throttling) while the debugger is attached, there were always several other downsides to it, and since this is only an issue with a debugger attached, we have decided to leave it as-is (also not cancelling will cause even bigger performance issues, as mentioned above). Unfortunately there's not really a way to prevent .NET from writing out first-chance cancel exceptions to the debugger window.

Harald_ØysteinLund1
Esri Contributor

I still get slow performance even if I run a Released exe file. It is really slow. Running Runtime 100.4

0 Kudos
dotMorten_esri
Esri Frequent Contributor

It's not a Debug vs Release build thing. It's whether the Visual Studio Debugger is attached to the process or not.

0 Kudos
Harald_ØysteinLund1
Esri Contributor

Yes, I'm aware of that, was just trying to point out that I was not running the application within VS. Bjørnar Sundsbø‌ pointed out an interesting theory that I can relate to in an answer to a thread I started: 

ArcGIS Runtime 100.4 draws basemap really slow when zooming with the mouse wheel

It seems that the animation slow down the drawing process, and that the cancellation do not occur, but I'm not certain about the non cancellation of the requests. 

0 Kudos
BjørnarSundsbø1
Occasional Contributor II

Bryan Roth, In regards to the exceptions, it might help to Enable Just My Code in Debugger Options to get rid of the exceptions. I never see the exceptions you posted above, but these are the ones displayed when I uncheck that box:

Exception thrown: 'System.ObjectDisposedException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.ObjectDisposedException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.ObjectDisposedException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll

However, on my end, I experience the problems Harald Øystein Lund describes, and I've added some more details about my newest findings to his post ArcGIS Runtime 100.4 draws basemap really slow when zooming with the mouse wheel.