<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MapTool creates lots of exceptions in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251298#M9335</link>
    <description>&lt;P&gt;Microsoft Visual Studio Enterprise 2022 (64-bit) - Current&lt;BR /&gt;Version 17.4.3&lt;/P&gt;&lt;P&gt;I think problem is in project or solution configuration.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 14:56:29 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2023-01-25T14:56:29Z</dc:date>
    <item>
      <title>MapTool creates lots of exceptions</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251245#M9331</link>
      <description>&lt;P&gt;I have a maptool where I just place a marker on a map. Nothing else, no other business logic.&lt;/P&gt;&lt;P&gt;The marker is placed fine, however - when you look at the debug the amount of exceptions thrown from ArcGIS.Dektop.Mapping.dll is concerning.&lt;/P&gt;&lt;P&gt;What is going on here, should this be happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vidar_0-1674654169321.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61172i4B19DE6EE6B84C2C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vidar_0-1674654169321.png" alt="Vidar_0-1674654169321.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is my simple code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;internal class FooTool : MapTool
{
    private IDisposable _graphic = null;

    public FooTool()
    {
        IsSketchTool = true;
        SketchType = SketchGeometryType.Point;
        SketchOutputMode = SketchOutputMode.Map;
    }

    protected override async Task&amp;lt;bool&amp;gt; OnSketchCompleteAsync(ArcGIS.Core.Geometry.Geometry geometry)
    {
        try
        {
            MapPoint mapPoint = (MapPoint)geometry;

            await QueuedTask.Run(() =&amp;gt;
            {
                var mapView = MapView.Active;
                //Show marker
                if (_graphic != null)
                {
                    _graphic.Dispose();
                }
                _graphic = mapView.AddOverlay(mapPoint, SymbolFactory.Instance.ConstructPointSymbol(ColorFactory.Instance.BlueRGB, 14, SimpleMarkerStyle.Pushpin).MakeSymbolReference());
            });
        }
        catch (ArgumentException ae)
        {
            ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(ae.Message, "Tool error");
        }
        catch (Exception ex)
        {
            Log.Error(ex);
        }

        return true;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 13:46:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251245#M9331</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2023-01-25T13:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: MapTool creates lots of exceptions</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251261#M9333</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have copied your code and it works fine on ArcGIS Pro 3.0.3 and ArcGIS Pro SDK for .NET 3.0.0.36057&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:14:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251261#M9333</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-01-25T14:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: MapTool creates lots of exceptions</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251272#M9334</link>
      <description>&lt;P&gt;What Visual Studio are you using? I am on:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vidar_0-1674656568494.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61179iA3198C006DA7DC7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vidar_0-1674656568494.png" alt="Vidar_0-1674656568494.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:22:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251272#M9334</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2023-01-25T14:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: MapTool creates lots of exceptions</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251298#M9335</link>
      <description>&lt;P&gt;Microsoft Visual Studio Enterprise 2022 (64-bit) - Current&lt;BR /&gt;Version 17.4.3&lt;/P&gt;&lt;P&gt;I think problem is in project or solution configuration.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:56:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251298#M9335</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-01-25T14:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: MapTool creates lots of exceptions</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251300#M9336</link>
      <description>&lt;P&gt;Where do you begin with this sort of stuff?! I did the migration process, but who knows if its done it 100% right. It would seem it hasn't ported cleanly.&amp;nbsp; I really don't want to start remaking all over project again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:59:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251300#M9336</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2023-01-25T14:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: MapTool creates lots of exceptions</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251311#M9337</link>
      <description>&lt;P&gt;I have created new tool (with FooTool nam) in existing Esri community sample project (3.0), then copy/pasted your code inside existing FooTool class&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 15:09:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251311#M9337</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-01-25T15:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: MapTool creates lots of exceptions</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251315#M9338</link>
      <description>&lt;P&gt;No I don't mean that. I mean my actual project/add-in. Its huge from version 2.x of Pro. If I have to start a new addin project and copy in all the code and start again - thats a real pain in the backside!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 15:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251315#M9338</guid>
      <dc:creator>Vidar</dc:creator>
      <dc:date>2023-01-25T15:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: MapTool creates lots of exceptions</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251337#M9339</link>
      <description>&lt;P&gt;I have solutions migrated from 2.x to 3.0, but I haven't issues like yours. Migration was painful to me too.&lt;/P&gt;&lt;P&gt;I have made all steps of migration documentation and repaired code changes.&lt;/P&gt;&lt;P&gt;Try to cleanup project. Check references of your project and etc.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 15:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/maptool-creates-lots-of-exceptions/m-p/1251337#M9339</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2023-01-25T15:36:17Z</dc:date>
    </item>
  </channel>
</rss>

