Select to view content in your preferred language

Function for writing custom project settings is not called when saving project programmatically

630
2
Jump to solution
04-15-2020 07:41 AM
BarbaraSchneider2
Frequent Contributor

I want to save some custom project settings (see ProGuide Custom settings · Esri/arcgis-pro-sdk Wiki · GitHub ). When I manually save the project, the function "OnWriteSettingsAsync()" is called. However, when I programmatically save the project using "Project.Current.SaveAsync()", the function "OnWriteSettingsAsync()" is not called.

Is there a workaround for this?

Thanks, Barbara

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

This could be the problem:  when you change your custom settings make sure you set the Project to reflect a dirty status with:  Project.Current.SetDirty (true);

View solution in original post

2 Replies
UmaHarano
Esri Regular Contributor

Hi Barbara

I modified the sample project referenced in that wiki page to save a project using the SaveAsync method. The OnWriteSettingsAsync method was called for me.

Is there anything specific about how you are calling SaveAsync?

Thanks

Uma

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

This could be the problem:  when you change your custom settings make sure you set the Project to reflect a dirty status with:  Project.Current.SetDirty (true);