Select to view content in your preferred language

Problems with "Build a map layout" tutorial

514
7
Jump to solution
06-05-2024 12:19 PM
RogerAsbury
Occasional Contributor

The tutorial is located here: Build a map layout | Documentation | ArcGIS Developers

Even if I download the solution from that page, when attempting to run from Visual Studio 2022, I receive errors. Target framework is .Net 8.0. 

The first error is a null reference - "Object reference not set to an instance of an object." - which occurs at the line:
newLayout = LayoutFactory.Instance.CreateLayout(newPage);

The second error seems to indicate that the Census Data map is having issues. Basically a server status code of 500. 

Copies of these errors are attached.

tutorialerrors.png

 

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
VedantBajaj
Esri Contributor

Hi @RogerAsbury We have updated the tutorial for Pro 3.3. Do check it out when you get a chance!

View solution in original post

7 Replies
RogerAsbury
Occasional Contributor

Update: A coworker tried this tutorial and had the same issues. We confirmed we meet the prerequisites. Does anyone have any idea what may be wrong in this tutorial? Would love to use this as it seems a relatively easy way of placing items on page for, as an example, basic reports or simple layouts.

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
0 Kudos
VedantBajaj
Esri Contributor

Hi @RogerAsbury We are working on this to get you a new tutorial. Will update this page once we have it published. Thanks!

VedantBajaj
Esri Contributor

Hi @RogerAsbury We have updated the tutorial for Pro 3.3. Do check it out when you get a chance!

RogerAsbury
Occasional Contributor

Oddly, while I still get the "Object reference not set to an instance of an object." error, the view does load and I see the map with legend as expected. Thanks much for looking into this. 🙂

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
0 Kudos
VedantBajaj
Esri Contributor

@RogerAsbury 

Based on the image above, it looks like you have modified a bit of the code. Running the directly download tutorial solution works without any errors for me. Could you share a snippet of the code you are running?

0 Kudos
RogerAsbury
Occasional Contributor

Code is attached. 

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
0 Kudos
VedantBajaj
Esri Contributor

Running this code piece does not generate any errors for me. I tried running this on both ArcGIS Pro 3.3 and 3.3.1.

I have 2 suggestions which come to my mind.

1. Try cleaning/rebuilding the solution under "Build" options. (restart and try again if it does not work). Another option could be deleting the addin in ArcGIS Pro under Add-In Manager Tab on the Backstage.

2. Check the properties of newPage variable before the LayoutFactory Instance is created (Attached screenshot for reference).

VedantBajaj_0-1719860063539.png

 

0 Kudos