Select to view content in your preferred language

"Index was outside the bounds of the array" Error When Using ArcGIS Pro Template or Adding New ArcGIS Pro Item

2121
5
Jump to solution
10-20-2021 06:50 AM
TheBobScript
Occasional Contributor

I recently configured my environment to develop using Visual Studio 2019 with ArcGIS Pro 2.7.0 and the ArcGIS Pro SDK 2.7.0.26828 (specific download - not as an automatically-updating extension). 

My assumption is that this combination of VS, Pro and the SDK should be compatible and allow me to create a new Visual Studio solution, but I encounter an error message saying "Index was outside the bounds of the array" anytime I attempt to use an ArcGIS Pro SDK template.

TheBobScript_0-1634737330263.png

I have been able to download a Pro SDK sample (MapLayoutSample) and successfully debug using that solution, however, if I attempt to add a new item (like an ArcGIS Pro Button or ArcGIS Pro ComboBox) I encounter the same error (Index was outside the bounds of the array).

I have removed the install of the SDK, re-installed and rebooted my machine, but it did not improve the situation.

0 Kudos
1 Solution

Accepted Solutions
SE1
by
New Contributor

- Try uninstalling (1) Pro SDK, (2) Pro, and (3) Visual Studio. (in that order)

- Then reinstall (1) Visual Studio, (2) Pro, and (3) Pro SDK. (in that order)

- Try creating a Pro SDK app (Add-in, CoreHost, Configuration) from template again.

View solution in original post

5 Replies
LukeHenderson1
Emerging Contributor

I am having the exact same issue with VS2022. Where you able to resolve this somehow?

0 Kudos
TheBobScript
Occasional Contributor

Unfortunately, I was never able to resolve the problem.  I continue to use the work-around of adding a new button, tool, etc from the samples or just copy and paste from existing template and perform any wiring manually.

I have been hopeful that eventually migrating to VS 2022 would address the issue, but that doesn't appear to be case   😞

0 Kudos
LukeHenderson1
Emerging Contributor

That is unfortunate. I will let you know if I am able to figure anything out. 

0 Kudos
SE1
by
New Contributor

- Try uninstalling (1) Pro SDK, (2) Pro, and (3) Visual Studio. (in that order)

- Then reinstall (1) Visual Studio, (2) Pro, and (3) Pro SDK. (in that order)

- Try creating a Pro SDK app (Add-in, CoreHost, Configuration) from template again.

TheBobScript
Occasional Contributor

@SE1- I recently had to stand-up a new machine, including a development environment for Pro.  I followed the sequence for installing that you suggested (1 - VS, 2 - Pro & 3 - Pro SDK) and I am now able to add a new button using the ArcGIS Pro Add-In template.