The setup:
I have a DataGrid with AllowDrop=”True”, and Drop=”MyDropEvent”. Let’s ignore the handling of the drop event, because it boils down to this:
If I attempt to drag/drop files from the Windows explorer onto my DataGrid while running my application through VS or after building to a .exe, it works: when dragging over the DataGrid, the cursor is correctly updated, and upon dropping, MyDropEvent is called.
However, if I package the same WPF application with MSIX, install the resulting msixbundle and run the installed app, dragging files from the explorer into my app just gives me the standard, red crossed out circle, and no DragOver or Drop event is ever called.
While I’ve been using DataGrid as an example, the same goes for other elements. It seems that drag/drop from the explorer is completely blocked somewhere.
I suspect this is some kind of permissions/security issue, though I don’t understand what exactly is going on or how to fix it.
I’ve checked the integrity levels for both my app and explorer.exe through Process Explorer, and both are at medium where I would expect them.
This is what my .appxmanifest looks like:
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
IgnorableNamespaces="uap rescap uap3">
<Identity
...
<Properties>
...
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName=...
Description=...
BackgroundColor="transparent"
Square150x150Logo="ImagesSquare150x150Logo.png"
Square44x44Logo="ImagesSquare44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="ImagesWide310x150Logo.png" Square71x71Logo="ImagesSmallTile.png" Square310x310Logo="ImagesLargeTile.png"/>
<uap:SplashScreen Image="ImagesSplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
<rescap:Capability Name="broadFileSystemAccess" />
<uap:Capability Name="removableStorage"/>
<uap:Capability Name="musicLibrary"/>
<uap3:Capability Name="backgroundMediaPlayback"/>
</Capabilities>
</Package>
broadFileSystemAccess was my latest attempt at fixing this, but to no success.
What am I missing? I’m curious what exactly is causing this, and whether there is a fix that ideally doesn’t involve completely restructuring how I build my app. I do need an MSIX package to upload to the MS store, unfortunately.
Cheers
1