I am developing a Windows 8 Metro app, and we intend to deploy it to only a few tablets within our company. It's not meant for the Windows Store.
We need the app to access some directories on the company's network share, but forcing the user to use a FilePicker
isn't what we want.
Our first attempt was to use await StorageFolder.GetFolderFromPathAsync("J:\\");
. This didn't work, and produced the following exception:
An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
WinRT information: Cannot access the specified file or folder (J:\). The item is not in a location that the application has access to (including application data folders, folders that are accessible via capabilities, and persisted items in the StorageApplicationPermissions lists). Verify that the file is not marked with system or hidden file attributes.
Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
So we tried replacing "J:\"
with the network path the drive was mapped to. This also didn't work, and we got this exception:
An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
WinRT information: Cannot access the specified file (\\domain\path\JDrive). Verify that there is a file type association declared in the manifest for this type of file and that the file is not marked with the system or hidden file attributes.
Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Our app has the following Capabilities:
- Enterprise Authentication
- Internet (Client)
- Private Networks (Client & Server)
Our app has no Declarations
This is all very reasonable for a Windows Store app, but is there any workaround for a simple in-house app that isn't going to the Store?