Hello,
I used a plugin in ArcGIS Pro 3.2, and after migrating it to ArcGIS Pro 3.3, my esriaddinx plugin no longer worked. When I examined the source code, I noticed a new error message:
Error message : "Gravité Code Description Projet Fichier Ligne État de la suppression
Erreur CS0508 'ShowCoordinatesTool.HandleMouseDownAsync(MapViewMouseButtonEventArgs)' : le type de retour doit être 'Task' pour correspondre au membre substitué"
in English (translated) : "Severity Code Description Project File Line Deletion Status Error CS0508 'ShowCoordinatesTool.HandleMouseDownAsync(MapViewMouseButtonEventArgs)': return type must be 'Task' to match overridden member."
Did you notice the same issue ?
protected override Task HandleMouseDownAsync(MapViewMouseButtonEventArgs e) ....//Get the map coordinates from the click point and set the property on the ViewModel. ........var camera = ActiveMapView.Camera; ........var sb = new StringBuilder(); ........vm.Text = sb.ToString(); ....}); |
Solved! Go to Solution.
I resolved this problem by changing of the .NET version 6 to 8 in the .csporj file of the old vs addin project
<TargetFramework>net6.0-windows</TargetFramework>
to
<TargetFramework>net8.0-windows</TargetFramework>
I cannot duplicate your issue. When you say you migrated your add-in to 3.3 did you upgrade your project to target .NET 8.0? I have a 3.1 add-in with a MapTool that also is using the HandleMouseDownAsync overrise and it worked fine under 3.3. When i migrated the project to ArcGIS Pro 3.3 i get the following when i hover over the HandleMouseDownAsync override:
Also can you check the definition for Task? It should be defined as follows:
I resolved this problem by changing of the .NET version 6 to 8 in the .csporj file of the old vs addin project
<TargetFramework>net6.0-windows</TargetFramework>
to
<TargetFramework>net8.0-windows</TargetFramework>