I am making an UWP app in C# where the user can choose to take a picture or use an exisiting one. The image picker is opened with this code
FileOpenPicker picker = new FileOpenPicker();
picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
picker.FileTypeFilter.Add(".jpg");
picker.FileTypeFilter.Add(".jpeg");
picker.FileTypeFilter.Add(".png");
StorageFile file = await picker.PickSingleFileAsync();
On a physical device I get this exception:
Exception thrown: 'System.Exception' in mscorlib.ni.dll
The drive cannot locate a specific area or track on the disk. (Exception from HRESULT: 0x80070019)
The weird thing is that I don't get an exception on any of the emulators and it used to work on the physical device too. Any suggestions or explanations?
.......................
You might want to check your Properties\WMAppManifest.xml file. Make sure that the matadata there is correct. For example, check if the Type attribute is correct ("badabumm.ScheduledAgent" in the example below).
<Tasks>
<DefaultTask Name="_default" NavigationPage="badabumm.xaml" />
<ExtendedTask Name="BackgroundTask">
<BackgroundServiceAgent Specifier="ScheduledTaskAgent" Name="badabumm Agent" Source="badabumm Agent" Type="badabumm.ScheduledAgent" />
</ExtendedTask>
</Tasks>
This solution was originally proposed in this source.
User contributions licensed under CC BY-SA 3.0