How to clear recent projects list in code

114
2
11-07-2017 03:34 PM
Highlighted
by
Occasional Contributor II

I am using the sample logic to get recent projects

var fileInfos = Project.GetRecentProjects().Select(f => new FileInfo(f));

But I want to know how to clear this list in code.  I want to update the user.config that stores the recent projects.  ArcGIS Pro does this when you try and open a recent project that no longer exists.  If you click on one, it will prompt you and ask you if you want to remove the project.  I have made a custom start page that loads the recent projects, but when a user clicks on a recent project from the list (that has been deleted from system), ArcGIS Pro Crashes.

I have attached the out of the box Prompt behavior that i want to mimic in the Pro SDK.

Tags (1)
2 Replies
Highlighted
New Contributor III

Did you ever figure this out?

Reply
0 Kudos
Highlighted
by
Occasional Contributor II

I haven't dug into this in a while.  I never could get it to clear the list of projects. I am sure there is a way to edit the xml.   I have to remove them manually.  I just delete RecentProjects items  from the file user.config in the directory 

%localappdata%l\ESRI\ArcGISPro.exe_StrongName_XXXXXXXX\2.1.0.0

The StrongName Folder name and version will vary of course, but goto %localappdata%l\ESRI\ and find the strongname folder and version.

I also like to cleanup my projects too. 

%userprofile%\documents\ArcGIS\Projects