Why does .NET say invalid JSON?

755
3
06-19-2017 07:46 PM
MichaelFrancis
New Contributor

I'm trying to access the USNG feature service from USNG 1000m UTM18 - NGA_US_National_Grid using:

Uri serviceUri = new Uri("url here");

ServiceFeatureTalbe featureTable = new ServiceFeatureTable(serviceUri);

Feature layer USNG = new FeatureLayer(featureTable);

await USNG.LoadAsync();

but it throws an exception: Invalid JSON.

Does anyone know why I can't load this service? I run a query of this service in a browser and it returns what seems to be correct JSON data, so why does Visual Studio throw this exception?

0 Kudos
3 Replies
dotMorten_esri
Esri Frequent Contributor

I tested this with v100.0 and I can reproduce the error. The good news is that if I try with the upcoming v100.1, the problem appears to have been fixed already. If you can wait a few weeks we'll have the new version out:

MRReddy
Occasional Contributor

May be you are using visual studio 2017, try using 2015

0 Kudos
dotMorten_esri
Esri Frequent Contributor

The version of VS used does not affect the runtime execution of this.

0 Kudos