ThinkGeo.com    |     Documentation    |     Premium Support

WmsTiledLayer - Exception

Ethan,

Here’s another exception being encountered. I set a breakpoint in the WMS Server that gets hit when the client issues an Open on a layer. If I stay in the debugger for something like 5 minutes then the exception below is encountered at the client.

Your thoughts?

Thanks,
Dennis

Hi Dennis,

Attached is a sample for TiledWMS layer, it works well in my machine, could you please try to run it and let me know whether it still met this exception?

And you can modify it to reproduce this exception, so we can make sure whether that’s the code reason or environment reason.

8732.zip (9.9 KB)

Regards,

Ethan

hi Ethan,

I downloaded your sample application and did a rebuild so it is using V10.02. When I enter debug mode the below exception occurs. This is one I’ve not seen before.

I’ve recently downloaded the ThinkGeo sample DisplayWmsRasterLayerSample-ForWinForms-master, which has almost identical code as 8732.zip, and it works just fine.

Here is the result of pinging the site…
ping ahocevar.com

Pinging ahocevar.com [104.27.163.149] with 32 bytes of data:
Reply from 104.27.163.149: bytes=32 time=30ms TTL=56
Reply from 104.27.163.149: bytes=32 time=32ms TTL=56
Reply from 104.27.163.149: bytes=32 time=30ms TTL=56
Reply from 104.27.163.149: bytes=32 time=31ms TTL=56

Ethan - I just went into Debug Mode again and it worked.

Dennis

Hi Dennis,

So it looks that works now?

Your exception information shows that’s a network problem, so I think that’s why the 2nd time you run it succeed.

Any question please let me know.

Regards,

Ethan

Ethan,

I upgraded from MapSuite V10.01 to V10.02 and this problem is partially solved.

The Layer Open method now results in an exception when the server is not available with the message – “Unable to connect to the remote server”. Under V10.01 this exception did not get passed back to the application and so the whole application crashed.

However, there is still an exception that is occurring inside of MapSuite. I start the WMS Server, I start the WMS Client, I display a layer in the client. Then I stop the WMS Server. At the client pan/zoom and MapSuite will crash as shown in the screen capture below.

Do you understand what I am talking about now? As long as the server is available my application has no issue. But as soon as the server is stopped the client will crash inside of MapSuite.

Does this make sense?

Just because the server was once available, but no longer available, MapSuite in the client should not crash, but gracefully handle this condition.

Dennis

Hi Dennis,

Thanks for you reply, I understand where is the problem now.

Our developer will look into it and see whether we can find a solution.

Regards,

Ethan

Hi Dennis,

Our developer had double check that, if you set the DrawingException property in overlay level that should works without crash.

Please view our sample here: 8732.zip (9.5 KB)

Wish that’s helpful.

Regards,

Ethan

Ethan,

I downloaded the sample and updated the NuGet packages and I do see the that map contains the pink tiles with X’s.

However, this is not my issue. I’m not sure you understand the issue I’m faced with.

As I stated in my previous post…“However, there is still an exception that is occurring inside of MapSuite. I start the WMS Server, I start the WMS Client, I display a layer in the client. Then I stop the WMS Server. At the client pan/zoom and MapSuite will crash as shown in the screen capture below.”

Does what I’m saying make sense to you?

Thanks,
Dennis

Hi Dennis,

Thanks for your reply, our developer will look into it, any update I will let you know.

Regards,

Ethan

Hi Dennis,

Our developer had fixed this problem, the exception reason will be drawn on tile.

Please update the 3 packages:



You can find the packages in one days.

And if you want to draw the exception information on tile, we suggest you set the DrawingException mode in overlay level, because the layer level cannot catch all exceptions for example the exception when you tried to open the layer.

Regards,

Ethan

hi Ethan,

I’ve updated with all the latest from MapSuite and implemented a timer that is enabled in the SendingWebRequest event and disabled in SentWebRequest. If the timer expires (I have it set to 5 seconds) the timer is disabled and a set of WmsRasterLayer.IsVisible = false is performed. In this case ThinkGeo.MapSuite.Wpf.dll appears to catch the exception and return it to WmsRasterLayer.Open, which then returns it to my application. This is all good.

However, there seems to be a timeout of about 120 seconds before WmsRasterLayer.Open returns with the exception.

Due to the environment that my product operates in, emergency communication centers, my users cannot afford to wait that long. I would like to programmatically change the wait time. Does MapSuite provide a method to change this wait time?

Well, I’ve just been doing more testing and I may have spoken too soon. In some cases I still get the exception inside MapSuite.

I’ve also been seeing that sometimes loading two layers from nearmap works and sometimes I get a timeout error/exception. I was consistently getting timeout exceptions in MapSuite attempting to load two layers from nearmap, states OHIO & PA. At least 5 times in a row I get the timeout. I then closed the Visual Studio solution, closed Visual Studio and restarted and then I could load OHIO & PA the very first time. Is MapSuite keeping data around that should be cleared or disposed?

After more testing after this update I’m getting more unusual things happening. Now the phrase " 29 DAYS LEFT" appears on my map. This must have something to do with license. How does one address this issue. I am on my development machine and my WpfDesktopEdition license is activated?

Also, I’ve been seeing on occasion instead of seeing the imagery I see just a plain white background.

Thanks,
Dennis

Hi Dennis,

Thanks for your description, it looks you met so many problems in your application. I listed the question here:

  1. If WMS server don’t reply, how to reduce the waiting time, the old value should be 120 seconds.

  2. Sometimes you met timeout error.

  3. You met eval exception sometimes.

  4. You met white blackground sometimes.

If I misunderstand please let me know.

For 1: Please try to set the Timeout for webrequest in the SendingWebRequest, it looks our wmsoverlay don’t contains related property.

For 2: I think that’s because your special format, you sent request to custom server, then sent another request to remote server, so sometimes the first request abort but the 2nd request still block the channel. I think only cache can help to reduce this problem.

For 3&4: Please try to add exception log in your server side code, so if you met the problem you can get the exception message and try to find what’s the reason of it.

Regards,

Ethan

hi Ethan,

Yes, I did encounter a lot of problems all of a sudden.

These issues are when my client application goes directly to nearmap.

Items #2 & #4 – I found what was causing the two US States of OHIO & PA not to load and to encounter timeout errors. I was setting the CurrentExtent of the MapControl to the ExpandedExtent of these two layers. I changed the code to not set CurrentExtent as shown below and now the two layers always appear.

Why do you think setting CurrentExtent caused this?

Old Code:

        TheAssetsStatic.aMapDisplay.CurrentExtent = TheBoundingBox;
        ThePointShape = TheBoundingBox.GetCenterPoint();
        TheMapDisplay.CenterAt(ThePointShape);
        TheMapDisplay.ZoomTo(ThePointShape, TheMapDisplay.ZoomLevelSet.ZoomLevel18.Scale);
        TheMapDisplay.Refresh();

New Code:

        ThePointShape = TheBoundingBox.GetCenterPoint();
        TheMapDisplay.CenterAt(ThePointShape);
        TheMapDisplay.ZoomTo(ThePointShape, TheMapDisplay.ZoomLevelSet.ZoomLevel18.Scale);
        TheMapDisplay.Refresh();

Item #3 – I am seeing “27 days left” while running in Visual Studio Debug Mode. When the exe is opened outside the debugger I do not see the eval notice. I updated to the latest MapSuite DLL’s including the latest Beta Version of MapSuite Barebones. How do I resolve the eval notice? What is the difference between Barebones & Standard?

Item #1 – I set WmsRasterLayer.TimeoutInSecond from the default of 20 to 5. Now 5 is a short time. But what it has shown is that when loading both OHIO & PA part of the image was returned and displayed, then my timer expired and so I sent WmsRasterLayer.IsVisible = false. As soon as that property was set received the following exception:

System.Net.WebException was unhandled
Message: An unhandled exception of type ‘System.Net.WebException’ occurred in ThinkGeo.MapSuite.Wpf.dll

Additional information: The request was aborted: The request was canceled.

Your thoughts?

Thanks,
Dennis

Hi Dennis,

  1. The CurrentExtent property contains complex calculate, generally it will works better, but you found set centerat and zoomto is works better for your scenario, please just keep that.

  2. About “27 days left”, please make sure all products you used is latest version and had been activated in your machine, and all cache had been cleared. The Barbone version only contains simplest packages, you can add the other ones you need, the standard contains all the packages, many of them is unused in common, we suggest you choose Barbone package.

  3. I don’t understand this question clearly, I guess you means after 5 seconds you set WmsRasterLayer.IsVisible = false but it thrown exception. Do you want to use this way to abort the sent request when timeout? Why not set the timeout in request directly?

Regards,

Ethan

hi Ethan,

About Item #2 – I now have 23 days left. This has something to do with MapSuite for WinForms because I opened the V10 Product Center and it also shows 23 days left for MapSuite WinForms. All my applications are WPF so somehow MapSuite WinForms has gotten into this MapSuite WPF application.

I’ve checked all my ThinkGeo packages for my application and they are WPF.

So somehow MapSuite for WinForms is caught up in my application.

What else can I check to determine where this is?

I do recall downloading one of your applications and it was a WinForms applications and I compiled it and it installed a eval copy for WinForms, which I would never have done if I knew it was going to install an eval copy. Is this where my trouble is? Can I uninstall MapSuite for WinForms?

Thanks,
Dennis

Hi Dennis,

I guess you have more than one account, I suggest you clear all you activation by each account, after that delete all cached packages and folders, get the latest package from NuGet again, login your mainly account, and activation the products one by one.

Then I wish your application works well.

Today I did a quickly test about set Winforms as eval and WPF as activated, it works correct.

Regards,

Ethan

Ethan,

I have never purchased MapSuite WinForms. I have WpfDesktopEdition and WMS Server. Compiling one of your WinForms provided applications installed an eval copy. So yes, on my machine I have WPF and WinForms, but I never wanted and don’t want WinForms.

How does one de-activate the eval copy of WinForms? And the bigger question is how did it get entangled with WpfDesktopEdition.

Would you be kind enough please to list all the cached nuget packages and folders?

I have removed all the cached packages that I could find and reinstalled the packages and I sill get the 22 days left.

Below is the MapSuite Product Center and you can see there is an eval for WinForms. I’m really perplexed as my applications do not use WinForms, they are WPF. How can I uninstall this eval of WinForms?

Also, this only happens in Visual Studio in Debug Mode. When the exe is started the 22 days left does not appear.

Thanks,
Dennis

Hi Dennis,

That’s very strange, please try this steps as below:

  1. Deactivate your WPF edition, important.

  2. Delete the Map Suite 10.0 in the two folders:
    C:\Users\user\AppData\Local\ThinkGeo
    C:\ProgramData\ThinkGeo

  3. Activate your WPF again.

  4. Upgrade your dlls and run again.

Please let us know whether that works.

Regards,

Ethan

Ethan,

I received additional help from Ben and successfully removed the eval version of V10 MapSuite WinForms.

The steps we followed are below. I did not need to update DLL’s. Just recompiled my applications.

Thanks for your help.

Dennis

  1. Start V10 MapSuite Product Center.

  2. Deactivate V10 WpfDesktopEdition.
    a. Press the WpfDesktopEdition Tile
    b. The Deactivate Button is enabled
    c. Press the Deactivate Button

  3. Stop V10 MapSuite Product Center.

  4. Delete V10 MapSuite Licenses
    a. C:\ProgramData\ThinkGeo\Map Suite 10.0\MapSuiteDevelopment.lic
    b. C:\Users\dberr\AppData\Local\ThinkGeo\Map Suite 10.0\Product Center\ProductCenter.key
    c. C:\Users\dberr\AppData\Local\ThinkGeo\Map Suite 10.0\Product Center\MapSuiteDevelopment.lic

  5. Start V10 MapSuite Product Center.
    a. Press the WpfDesktopEdition Tile
    b. The Activate Button is enabled
    c. Press the Activate Button

Hi Dennis,

Thanks for your share, your steps should be helpful for the guys who met same problem.

Regards,

Ethan