I have tried using the sample to connect to a WMS server and it worked fine. When I connect to my own WMS server it requires that I update the "Crs" property to a supported format, this is OK and I can get the capabilities from the server.
Debug
.WriteLine(wmsImageLayer.GetRequestUrl(winformsMap1.CurrentExtent, winformsMap1.Width, winformsMap1.Height));
The above code when using the standard sample has the server name of the sample - OK.
When I update the Crs property to
wmsImageLayer.Crs =
"EPSG:2154";
Which is the only one supported by my server then I can get the capabilities and the layer names.
Debug.WriteLine(wmsImageLayer.GetRequestUrl(winformsMap1.CurrentExtent, winformsMap1.Width, winformsMap1.Height));
This code reports that the server Url has been reset to "localhost" and the application cannot be found a "404 error".
What is going on? - why would the server Url be reset just by updating the Crs property?
If I don't update the Crs property then the server name is the correct one but it doesn't work because then I get "This CRS is not supported in the Wms server: "