PROBLEM

ArcGIS Pro SDK 3.0 item template compilation error in Microsoft Visual Studio 2022

Last Published: June 12, 2024

Description

Adding item templates like ‘ArcGIS Pro Custom Item’ to an ‘ArcGIS Pro Managed Configuration’ or ‘Module Add-in’ can cause ‘CS0103’ errors when compiling the project. The products affected by this include:  Microsoft Visual Studio 2022, ArcGIS Pro SDK for .Net 3.0, and ArcGIS Pro release 3.0 and later.

This error can occur after the following item templates are added to an existing ‘ArcGIS Pro Managed Configuration’ or ‘Module Add-in’ project:

  • ArcGIS Pro Custom item
  • ArcGIS Pro Custom Project Item
  • ArcGIS Pro Gallery
  • ArcGIS Pro Inline-Gallery

 When attempting to build a project after adding one of these item templates, the following compile errors are shown, as seen in the image below:

“CS0103 The name … does not exist in the current context”

Graphical user interface, text  Description automatically generated

 

Cause

The problem is random and was observed in newer releases of Visual Studio 2022 starting with build 17.3.x and newer.  The problem can be caused by the ‘ItemType="Resource"’ attribute in the ‘ProjectItem’ tag in the vstemplate file of the item template. Only the following item templates specified this attribute:

  • ArcGIS Pro Custom item
  • ArcGIS Pro Custom Project Item
  • ArcGIS Pro Gallery
  • ArcGIS Pro Inline-Gallery

Consequently, the error is limited to these item templates.

Solution or Workaround

Download and install the latest version of proapp-sdk-templates.vsix, or install the latest releases from the Visual Studio Marketplace: ArcGIS Pro SDK for .NET - Visual Studio Marketplace.

Article ID:000028881

Software:
  • ArcGIS Pro SDK for Microsoft NET
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 2
  • ArcGIS Pro 3 0
  • ArcGIS Pro 3 3

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options