FileSystem.Current.AppDataDirectory returns an invalid path when built for Windows as unpackaged #22231
Labels
area-essentials
Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info
delighter-sc
fixed-in-8.0.70
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
I'm getting very different results for FileSystem.Current.AppDataDirectory between VS22 and VS Code. Both claim to be using .NET 8.0.300-preview.24203.14. The fact they are different was confusing, but I learned VS Code preview is defaulting to unpackaged.
"User Name" is the publisher name from the manifest. We should give this a better name.
Also, would be good if we actually create this folder when used.
Preferences
used to do this according to @mattleibow .VS22 says it's
C:\Users\davidortinau\AppData\Local\Packages\com.simplyprofound.sentencestudio_9zz4h110yvjzm\LocalState\
VS Code says it's
C:\Users\davidortinau\AppData\Roaming\User Name\com.simplyprofound.sentencestudio\Data\
Both are debugging to Windows. Same project. Packaged version doesn't require manual creation, but unpackaged seems it does. When I try to put my database there it has create permissions - must only apply to the file, not the path.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
8.0.21 SR4.1
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
No response
Did you find any workaround?
Didn't try, but could probably create the folder myself.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: