Select to view content in your preferred language

Why a local package is not modified?

754
4
Jump to solution
10-08-2013 10:31 AM
Labels (1)
Cristian_Galindo
Frequent Contributor
Hello,

I just develop an small ArcGIS runtime app, this app initialize a local feature service:

var localCenterlineServiceMPK = new LocalFeatureService()             {                 Path = @"C:\Users\XXX\Documents\PackageMap.mpk"             };             localCenterlineServiceMPK.StartCompleted += this.StartCompleted;              localCenterlineServiceMPK.StartAsync();


then I get a layer for that package (only has one)

private void StartCompleted(object sender, AsyncCompletedEventArgs e)         {             var centerlineLayerService = sender as LocalFeatureService;              var centerlineLayer = new ArcGISLocalFeatureLayer { Service = centerlineLayerService, ID = "Routes", LayerName = "routes", Editable = true, AutoSave = true, ReturnM = true };              this._map.Layers.Add(centerlineLayer);         }


I create some lines and add it to the layer, the lines appears on the map.

then I close the application and proceed to open the file C:\Users\XXX\Documents\PackageMap.mpk using ArcMap, to discover that the features weren't saved. (the package includes the geodatabase).

Funny part: I reopen the application....and voila!!!! the features are there.

I found that the local server unpacked the contents of the package to :
C:\Users\MyUser\AppData\Local\ArcGISRuntime\Documents\ArcGIS\Packages\packagemap

in that path resides a copy of the geodatabase, but neither it has the changes in the features.

It is driving me crazy!!!!!!! where are the features???
0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor
Hi,

That's an interesting idea, but not the way packages were designed to work - it's a one-way distribution model. Therefore, in order to pick up the edited geodatabase and push it back again you have two options:

1. Set the ArcGISRuntime.AppDataPath to the location you would like on the deployment machine - and then retrieve the unpacked/edited geodatabase from the unpack location.
2. Package with reference to your geodatabase then deploy that along with your application. This is the recommended approach.

Note that we are currently implementing a richer editing framework which includes synchronization with feature services (or Desktop via checkout/checkin) - that will be available in the new ArcGIS Runtime SDK for .NET which will be available as a public beta later this year.

Cheers

Mike

View solution in original post

0 Kudos
4 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

The features you created will be in the package unpack location e.g. C:\Users\MyUser\AppData\Local\ArcGISRuntime\Documents\ArcGIS\Packages\packagemap.

You can control the unpack location be setting the ArcGISRuntime.AppDataPath property.

Alternatively, when packaging you can choose to reference your File Gdb (or enterprise Gdb) from the MPK rather than import the data into the MPK. This workflow only supports absolute paths, not relative paths.

Cheers

Mike
0 Kudos
Cristian_Galindo
Frequent Contributor
thanks for your answer!,

But I want to persist the changes made by the application in the original package. If runtime unpacked the information, It should packed again, Should not?
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

That's an interesting idea, but not the way packages were designed to work - it's a one-way distribution model. Therefore, in order to pick up the edited geodatabase and push it back again you have two options:

1. Set the ArcGISRuntime.AppDataPath to the location you would like on the deployment machine - and then retrieve the unpacked/edited geodatabase from the unpack location.
2. Package with reference to your geodatabase then deploy that along with your application. This is the recommended approach.

Note that we are currently implementing a richer editing framework which includes synchronization with feature services (or Desktop via checkout/checkin) - that will be available in the new ArcGIS Runtime SDK for .NET which will be available as a public beta later this year.

Cheers

Mike
0 Kudos
Cristian_Galindo
Frequent Contributor
Hello,

again, thanks for your response.
0 Kudos