Select to view content in your preferred language

Load FileGDB (export from ArcGIS Pro) via Map SDK

44
0
a month ago
Labels (1)
JunGuan
New Contributor II

We use ArcGIS Pro to export a group layer into a lyrx file. This layer file indicates a FileGDB in the dataConnection:

 "dataConnection" : {
"type" : "CIMStandardDataConnection",
"workspaceConnectionString" : "DATABASE=C:\\Users\\****\\****\\Documents\\ArcGIS\\Packages\\KEk_GIS_20230414a_ajs_for_Geosoft_1ff973\\p20\\ek_map_20220622_ajs.gdb",
"workspaceFactory" : "FileGDB",
"dataset" : "DescriptionOfMapUnits",
"datasetType" : "esriDTTable"
}, 

We try to load this fileGDB with Map SDK based on this post https://community.esri.com/t5/net-maps-sdk-questions/have-to-add-feature-classes-from-file-geodataba.... But the sample in this post is for v100.7, and does exist in the current version(>100.15).

1) I try to add the sample into the current version. and get the following error when run it

---------------------------
Error
---------------------------
Esri.ArcGISRuntime.Http.ArcGISWebException: Failed to create service mpk_blank MapServer. Wrong package type used to start service

at Esri.ArcGISRuntime.Http.HttpDispatcher.SendAsync(HttpRequestMessage request, HandlerOptions options, CancellationToken cancellationToken)

at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)

at Esri.ArcGISRuntime.LocalServices.LocalService.StartServiceInternal(IDictionary`2 serviceSpecificParams, CancellationToken cancellationToken)

at ArcGISRuntime.WPF.Samples.DynamicWorkspaceShapefile.DynamicWorkspaceShapefile.StartLocalMapService(String filename, String path) in D:\others\arcgis-maps-sdk-dotnet-samples\src\WPF\WPF.Viewer\Samples\LocalServer\DynamicWorkspaceShapefile\DynamicWorkspaceShapefile.xaml.cs:line 107
---------------------------
OK
---------------------------

 

2) I try to update the "Local Server Image Map Layer" sample to load the FileGDB as the following

 

JunGuan_0-1718640213198.png

But I got the following error at line 106. 

Esri.ArcGISRuntime.Http.ArcGISWebException
HResult=0x00000000
Message=Unable to find the specified 'dataSourceName' in 'dataSource' for dynamic dataLayer with 'id': 0.
Source=Esri.ArcGISRuntime
StackTrace:
at Esri.ArcGISRuntime.Http.HttpDispatcher.<SendAsync>d__14.MoveNext()
at Esri.ArcGISRuntime.Internal.RequestHandler.<IssueRequestAndRespond>d__4.MoveNext()
at ArcGIS.WPF.Samples.LocalServerMapImageLayer.LocalServerMapImageLayer.<Initialize>d__2.MoveNext() in D:\others\arcgis-maps-sdk-dotnet-samples\src\WPF\WPF.Viewer\Samples\LocalServer\LocalServerMapImageLayer\LocalServerMapImageLayer.xaml.cs:line 125

This exception was originally thrown at this call stack:
[External Code]
ArcGIS.WPF.Samples.LocalServerMapImageLayer.LocalServerMapImageLayer.Initialize() in LocalServerMapImageLayer.xaml.cs

 

My question is:

Is Map SDK able to load a FileGDB from ArcGIS Pro? if it is, would you please provide a sample code for this issue? 

Thanks. 

 

Tags (1)
0 Kudos
0 Replies