Hi - I've migrated project from 2.9 to 3.0 and am using this code in an attempt to get the layout:
using ArcGIS.Desktop.Core;
using ArcGIS.Desktop.Mapping;
using ArcGIS.Desktop.Layouts;
using ArcGIS.Desktop.Framework.Contracts;
using ArcGIS.Desktop.Framework.Threading.Tasks;
using ArcGIS.Core.CIM;
...
string paneName = activePane.Caption;
LayoutProjectItem layoutProjItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals(paneName));
...
Getting error: type or namespace name 'LayoutProjectItem' could not be found.
I see an ArcGIS Pro sdk 3.0 code snippet that looks like the code I'm using:
LayoutProjectItem layoutItem = Project.Current.GetItems<LayoutProjectItem>() .FirstOrDefault(item => item.Name.Equals("MyLayout"));
What am I missing? The 'LayoutProjectItem' at 2.0 was in ArcGIS.Desktop.Layouts
Thanks
Pete
Solved! Go to Solution.
FYI: that's the content of the ArcGIS.Desktop.Layouts namespace in the Extensions assembly.
https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic74111.html
Double check that you have a good reference to the ArcGIS.Desktop.Layouts assembly in your project.
It is still there. U have something else going on.
https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic11105.html
FYI: that's the content of the ArcGIS.Desktop.Layouts namespace in the Extensions assembly.
https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic74111.html
Double check that you have a good reference to the ArcGIS.Desktop.Layouts assembly in your project.
that was it -- assembly needed to be added. Thanks!