I am trying to open a Mobile Map Package. When I do I get an error that the file does not exist even though it does.
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN> File<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Exists</SPAN><SPAN class="punctuation token">(</SPAN>item<SPAN class="punctuation token">.</SPAN>MapPackagePath<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
Console<SPAN class="punctuation token">.</SPAN><SPAN class="token function">WriteLine</SPAN><SPAN class="punctuation token">(</SPAN>item<SPAN class="punctuation token">.</SPAN>MapPackagePath<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MobileMapPackage mapPackage <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> MobileMapPackage<SPAN class="punctuation token">.</SPAN><SPAN class="token function">OpenAsync</SPAN><SPAN class="punctuation token">(</SPAN>item<SPAN class="punctuation token">.</SPAN>MapPackagePath<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
RuntimeControls<SPAN class="punctuation token">.</SPAN>Map <SPAN class="operator token">=</SPAN> mapPackage<SPAN class="punctuation token">.</SPAN>Maps<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</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>The output from the Console.Writeline followed by the error:
D:\Mobile\Packages\Gas_Network.mpkx
System.IO.FileNotFoundException: File not found: D:\Mobile\Packages\Gas_Network.mpkx ---> Esri.ArcGISRuntime.ArcGISRuntimeException: File not found: D:\Mobile\Packages\Gas_Network.mpkx
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Esri.ArcGISRuntime.Mapping.MobileMapPackage.<OpenAsync>d__4.MoveNext()<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Anyone know why it does not find a file that obviously exists?