Select to view content in your preferred language

Adding new C# items from ArcGIS Pro Add-ins creates error

673
3
09-06-2022 03:13 AM
TomGeo
by
Frequent Contributor

I want to add an ArcGIS Pro Gallery to my project, but after naming it only a cs file is created, but no template xaml file, and the gallery isn't reflected in the config daml file either. I also checked and it is not only the gallery, it is any item from the ArcGIS Pro Add-ins group.

Instead I receive this error message

TomGeo_0-1662458806078.png

In addition I got this error message when trying to add ArcGIS Pro DAML IDs

TomGeo_0-1662461375771.png

How can I get full functionality back in my project?

 

I am using Visual Studio in version 17.3.3 with ArcGIS Pro SDK for .NET version 3.0.0.3656. The project was migrated from an 2.9 project.

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
3 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

I suspect that you have a configuration mismatch on your development machine.  Please check this:

1) look at the installation path for your 3.0.0.3656 release of ArcGIS Pro (by default this is "C:\Program Files\ArcGIS\Pro\bin\"

2) open your project file and check the paths for all Pro assembly references

3) the paths in the project file should match the installation path

I tested the complete workflow that you described using your release versions, and everything worked as expected.   It's possible that the name of the folder to which you want to add your gallery could be the issue.  What folder and what name do you try to use when adding the gallery?  Also were you able to build the project after the conversion to 3.0?

0 Kudos
TomGeo
by
Frequent Contributor

Thanks for your reply @Wolf !

My AGP installation is at the default path, but I have to admit, I do not know where Visual Studio is installing the ArcGIS Pro SDK for .Net to. That would be version 3.0.0.3656

All assembly references go to the AGP bin directory or sub-directories of it and I was able to verify the existence of each dll file within the corresponding path.

The paths in the project file match the ones shown in the assembly references, and are correct. The only thing that I found in the project file was that the reference to ArcGIS.Desktop.Resources was there twice.

I tried to add the gallery directly into the project, and the project goes by the name 'PublicData', whereas the name for the gallery was set to 'DataforsyningenGallery.cs', but also the default name of 'Gallery1.cs' fails with the same error.

After migrating the project to 3.0 I was, and still are able to build the project. But it seems as if I cannot add ArcGIS items to it anymore.

 

Finally, I created a new solution + project, and here I have no problems adding ArcGIS items to the project. So the issue is rather within the project then the general setup of the machine.

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

@TomGeo  can you message me your 2.9 and 3.0 csproj files?   I wrote the 3.0 Migration Vsix and I will take a look to see what is going on with your project migration.  You can use the messages button to send me a private message with attachments, just zip and attach the two project files. 

0 Kudos