PROBLEM
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:
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”
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:
Consequently, the error is limited to these item templates.
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
Get help from ArcGIS experts
Download the Esri Support App