I'm developing an Xamarin.Forms mapping app to Android and UWP Platforms using ESRI ArcGISRuntime SDK .NET 100.0 . As part of the workflow the app loads a basemap and a lot of different operational layers based on ArcGIS Tiled and Dynamic Map Services. At almost all development time I wrote and tested code in Debug mode of Visual Studio 2017 and everything went right. But as part of testing time I made a Release apk and appx files to tester teams. The testers of Android version reported that installations went OK, but Windows 10 and Windows 10 Mobile testers reported that basemaps and operational layers did not load. Then I tested inside Visual Studio launching the UWP project in Release mode and I realized that it was true. On the other hand, to upload the application packages to the stores (Play Store and Windows Store) the app must me compiled in Release mode.
Checking the two configurations at project property window I noted there was a pair of differences among Debug and Release mode the "General / Compile with .NET Native tool chain" checkbox was not checked in the first case and checked in the second case:


I wrote a lite version of the app to proof the point, and the behavior is the same: this is the code of the ViewModel class of the MapPage.xaml that does this part of the workflow:
<SPAN class="keyword token">using</SPAN> Esri<SPAN class="punctuation token">.</SPAN>ArcGISRuntime<SPAN class="punctuation token">.</SPAN>Mapping<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">using</SPAN> Prism<SPAN class="punctuation token">.</SPAN>Mvvm<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">using</SPAN> Prism<SPAN class="punctuation token">.</SPAN>Services<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">using</SPAN> System<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">using</SPAN> Xamarin<SPAN class="punctuation token">.</SPAN>Forms<SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// </SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="keyword token">namespace</SPAN> MapTest<SPAN class="punctuation token">.</SPAN>ViewModels
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// </SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="keyword token">public</SPAN> <SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">MapPageViewModel</SPAN> <SPAN class="punctuation token">:</SPAN> BindableBase
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">private</SPAN> Map _map<SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// </SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="keyword token">public</SPAN> Map Map
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">get</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">return</SPAN> _map<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">set</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="token function">SetProperty</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">ref</SPAN> _map<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">value</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">private</SPAN> IPageDialogService dialogService<SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// </SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="comment token">/// <returns></returns></SPAN>
<SPAN class="keyword token">public</SPAN> IPageDialogService <SPAN class="token function">GetDialogService</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">return</SPAN> dialogService<SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// </SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="comment token">/// <param name="value"></param></SPAN>
<SPAN class="keyword token">public</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">SetDialogService</SPAN><SPAN class="punctuation token">(</SPAN>IPageDialogService <SPAN class="keyword token">value</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
dialogService <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">value</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// </SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="keyword token">public</SPAN> <SPAN class="token function">MapPageViewModel</SPAN><SPAN class="punctuation token">(</SPAN>IPageDialogService dialogService<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
Map <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Map</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="token function">SetDialogService</SPAN><SPAN class="punctuation token">(</SPAN>dialogService<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="token function">AddLayers</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// </SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="keyword token">private</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">AddLayers</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">try</SPAN>
<SPAN class="punctuation token">{</SPAN>
Map<SPAN class="punctuation token">.</SPAN>Basemap <SPAN class="operator token">=</SPAN> Basemap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateTopographic</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="token function">AddLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver5.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FElevation%2FWorldElevations%2FMapServer" target="_blank">http://sampleserver5.arcgisonline.com/arcgis/rest/services/Elevation/WorldElevations/MapServer</A><SPAN>"</SPAN></SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"dynamic"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="token function">ShowAlert</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"MapTest"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Finish"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">catch</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="token class-name">Exception</SPAN> ex<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="token function">ShowAlert</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Exception"</SPAN><SPAN class="punctuation token">,</SPAN> ex<SPAN class="punctuation token">.</SPAN>Message<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// </SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="comment token">/// <param name="url"></param></SPAN>
<SPAN class="comment token">/// <param name="tipo"></param></SPAN>
<SPAN class="keyword token">private</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">AddLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">string</SPAN> url<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">string</SPAN> tipo<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
Layer layer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>tipo <SPAN class="operator token">==</SPAN> <SPAN class="string token">"tiled"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
layer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGISTiledLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Uri</SPAN><SPAN class="punctuation token">(</SPAN>url<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>tipo <SPAN class="operator token">==</SPAN> <SPAN class="string token">"dynamic"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
layer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGISMapImageLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Uri</SPAN><SPAN class="punctuation token">(</SPAN>url<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">try</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>Map<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>layer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="token function">ShowAlert</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"MapTest"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"layer Added."</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">catch</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="token class-name">Exception</SPAN> ex<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">throw</SPAN> ex<SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token">/// <summary></SPAN>
<SPAN class="comment token">/// /</SPAN>
<SPAN class="comment token">/// </summary></SPAN>
<SPAN class="comment token">/// <param name="title"></param></SPAN>
<SPAN class="comment token">/// <param name="message"></param></SPAN>
<SPAN class="keyword token">private</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">ShowAlert</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">string</SPAN> title<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">string</SPAN> message<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
System<SPAN class="punctuation token">.</SPAN>Diagnostics<SPAN class="punctuation token">.</SPAN>Debug<SPAN class="punctuation token">.</SPAN><SPAN class="token function">WriteLine</SPAN><SPAN class="punctuation token">(</SPAN>message<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
Device<SPAN class="punctuation token">.</SPAN><SPAN class="token function">BeginInvokeOnMainThread</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">async</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">await</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetDialogService</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">DisplayAlertAsync</SPAN><SPAN class="punctuation token">(</SPAN>
title<SPAN class="punctuation token">,</SPAN>
message<SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"Close"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>The complete solution is published at github in this address: https://github.com/marceloctorres/MapTest.
Someone can help me to find the solution or at least a workaround? I would appreciate it.
Marcelo.