Open lostmsu opened 10 months ago
Tagging subscribers to this area: @dotnet/area-system-io See info in area-owners.md if you want to be subscribed.
Author: | lostmsu |
---|---|
Assignees: | - |
Labels: | `area-System.IO` |
Milestone: | - |
@Jozkee could you PTAL?
Is CreateAsSymbolicLink
silently failing?
@lostmsu do you have steps on how to run that code on a Desktop bridge app?
silently failing? No, it creates a symlink, but the destination is non-virtualized path, and trying to read the content immediately fails. So does an attempt to remove the symlink.
See the attached project sample.
If it was not clear - Windows only.
Be sure that you run virtualized (e.g. Packaged) variant only. The virtualization shenanigans annoyingly can make the test pass if all the files exist in non-virtualized locations.
No, it creates a symlink, but the destination is non-virtualized path, and trying to read the content immediately fails. So does an attempt to remove the symlink.
I see, yes. I think this may be a problem related to the windows API CreateSymbolicLinkW which doesn't take into account the virtualized context, so we may not be able to fix it.
@lostmsu Which environment are you using for this? We tried to repro this on Win 11 23H2 and we were not able to repro the issue - the sym link worked as expected.
Description
My app is packaged using DesktopBridge to be published in Store.
The issue is that when I create a symbolic link from withing my app's subfolder of
AppData\Local
(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\MyApp"
), it is not functional as it points to non-virtualized location.Reproduction Steps
This has to be run from a desktop bridge app
Expected behavior
Actual behavior
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response