Select to view content in your preferred language

Setting Alias on MapProjectItem does not retain

533
2
Jump to solution
12-01-2022 07:38 AM
LynneB
by
New Contributor

I'm trying to set the Alias on a MapProjectItem.  The code works and the value is set if I repeat the code in the same Pro session but once I exit Pro and go back in, the Alias is back to null.

                IEnumerable<MapProjectItem> mapItems = Project.Current.GetItems<MapProjectItem>();
                foreach (MapProjectItem mapItem in mapItems)
                {
                    mapItem.Alias = "DA Test Alias";
                }

 

I'm using Pro 3.0

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I was able to duplicate the issue with the Alias property not retaining its value between sessions even when i explicitly save the project.  I reported this as an issue to the Framework dev team.  Thanks for reporting this issue.

View solution in original post

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

I think you need to save project:

await Project.Current.SaveAsync();
0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I was able to duplicate the issue with the Alias property not retaining its value between sessions even when i explicitly save the project.  I reported this as an issue to the Framework dev team.  Thanks for reporting this issue.

0 Kudos