<?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: CannotUnloadAppDomainException when starting a LocalGeometryService in an add-in in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/cannotunloadappdomainexception-when-starting-a/m-p/388822#M1936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As an update, if I change the activation of the add-in to run in the same AppDomain, then the Exception does not occur.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2012 16:32:10 GMT</pubDate>
    <dc:creator>JonathanBailey</dc:creator>
    <dc:date>2012-05-24T16:32:10Z</dc:date>
    <item>
      <title>CannotUnloadAppDomainException when starting a LocalGeometryService in an add-in</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/cannotunloadappdomainexception-when-starting-a/m-p/388821#M1935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've created a small prototype to test accessing ArcGIS Runtime functionality from within a WPF application plug-in. I've created a simple add-in that, when invoked, creates a LocalGeometryService and calls StartAsync. After the application loads, after a few seconds an unhandled CannotUnloadAppDomainException occurs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;System.CannotUnloadAppDomainException was unhandled
&amp;nbsp; Message=Error while unloading appdomain. (Exception from HRESULT: 0x80131015)
&amp;nbsp; Source=mscorlib
&amp;nbsp; StackTrace:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.AppDomain.Unload(AppDomain domain)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.AddIn.Pipeline.ContractBase.AppDomainUnload()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Threading.ThreadHelper.ThreadStart()
&amp;nbsp; InnerException:&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the add-in doesn't call StartAsync on the LocalGeometryService, then the exception does not occur. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideas on why this is happening?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following is some of the output from the application (truncated to fit within the post):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\ArcGISWPFPlugInHost.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.AddIn\v4.0_4.0.0.0__b77a5c561934e089\System.AddIn.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 'vshost.NotifyLoad' (0x11b4) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0xb88) has exited with code 0 (0x0).
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\ArcGISWPFPlugInHost.exe', Symbols loaded.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Step into: Stepping over non-user code 'ArcGISWPFPlugInHost.App.App'
Step into: Stepping over non-user code 'ArcGISWPFPlugInHost.App.InitializeComponent'
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\ArcGISWPFHostView.dll', Symbols loaded.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\ESRI.ArcGIS.Client.dll'
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\ESRI.ArcGIS.Client.Local.dll'
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.AddIn.Contract\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.AddIn.Contract.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\Pipeline\Contracts\ArcGISWPFPlugInContract.dll', Symbols loaded.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\Pipeline\AddInViews\ArcGISWPFPlugInView.dll', Symbols loaded.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\Pipeline\AddIns\ArcGISWPFPlugIn\ArcGISWPFPlugIn.dll', Symbols loaded.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\Pipeline\AddInSideAdapters\ArcGISWPFPlugInAdapter.dll', Symbols loaded.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\Pipeline\AddIns\ArcGISWPFPlugIn\ESRI.ArcGIS.Client.Local.dll'
ArcGISWPFPlugIn created
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\Pipeline\AddIns\ArcGISWPFPlugIn\ESRI.ArcGIS.Client.dll'
ArcGISRuntime: ArcGIS Runtime starting 
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly'
ArcGISRuntime: ArcGIS Runtime started version: 1.0.0.3057 url: http://127.0.0.1:50000/nPkjFB/arcgis/rest/services
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\temp\ArcGISWPFPlugIns\Pipeline\HostSideAdapters\ArcGISWPFHostAdapter.dll', Symbols loaded.
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly'
ArcGISRuntime: ArcGIS Runtime starting 
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationTypes.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
ArcGISRuntime: ArcGIS Runtime started version: 1.0.0.3057 url: http://127.0.0.1:50001/yt3GjG/arcgis/rest/services
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll'
'ArcGISWPFPlugInHost.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.DurableInstancing\v4.0_4.0.0.0__31bf3856ad364e35\System.Runtime.DurableInstancing.dll'
The thread '&amp;lt;No Name&amp;gt;' (0xd80) has exited with code 0 (0x0).
The thread '&amp;lt;Thread Ended&amp;gt;' (0x117c) has exited with code 0 (0x0).
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 15:05:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/cannotunloadappdomainexception-when-starting-a/m-p/388821#M1935</guid>
      <dc:creator>JonathanBailey</dc:creator>
      <dc:date>2012-05-24T15:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: CannotUnloadAppDomainException when starting a LocalGeometryService in an add-in</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/cannotunloadappdomainexception-when-starting-a/m-p/388822#M1936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As an update, if I change the activation of the add-in to run in the same AppDomain, then the Exception does not occur.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 16:32:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/cannotunloadappdomainexception-when-starting-a/m-p/388822#M1936</guid>
      <dc:creator>JonathanBailey</dc:creator>
      <dc:date>2012-05-24T16:32:10Z</dc:date>
    </item>
  </channel>
</rss>

