ThinkGeo.com    |     Documentation    |     Premium Support

Exception thrown attempting to obtain layer names using WmtsAsyncLayer

We are in the process of upgrading from Winforms 10 to Winforms 14. There is a lot of code that simply does not work following the upgrade. In this case we are attempting to retrieve a list of available layer names from a WMTS server using the method WmtsAsyncLayer.GetServerLayerNames. Before calling this method we open the layer using OpenAsync. When the method is called, the following exception is thrown:

System.InvalidOperationException: The FeatureSource is not open.   Please call the Open method before calling this method.
   at ThinkGeo.Core.ValidatorHelper.CheckFeatureSourceIsOpen(Boolean isOpen)
   at ThinkGeo.Core.WmtsAsyncLayer.GetServerLayerNames()
   at ThinkGeo_14_Demo.Form1.VB$StateMachine_31_mAddWmtsLayer.MoveNext() in C:\Users\steller\source\repos\ThinkGeo_14_Demo\Form1.vb:line 156

NOTE: If we set the property ActiveLayerName before calling OpenAsync the exception is not thrown. The problem is we don’t know what the layers are before we call GetServerLayerNames.

I have attached a sample project to demonstrate the issue.

Thanks!

Steve

ThinkGeo_14_Demo.zip (742.6 KB)

Hi Steve,

Thanks for the sample project. It looks like this bug was fixed in the latest 14.4 daily build. If you pull the 14.4.0-beta 111 build in NuGet, it should work (see screenshot below). Sorry for the inconvenience.

Sorry that the upgrade from v10 to v12+ has been troublesome. We will not have a new release in the future that had as many changes as v12. You can check out the conversion guide below for a little head-start on upgrading to the latest version. Although it was written to v12, a lot of it still applies to v14.

https://thinkgeo.com/blog/thinkgeo-10-to-12-conversion-guide

Thanks,
John