Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSystem.Current.AppDataDirectory returns an invalid path when built for Windows as unpackaged #22231

Closed
davidortinau opened this issue May 6, 2024 · 4 comments · Fixed by #23265
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

Comments

@davidortinau
Copy link
Contributor

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

@davidortinau davidortinau added the t/bug Something isn't working label May 6, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@marossi7
Copy link

marossi7 commented May 15, 2024

Any solution to this ?

I have the same problem, FileSystem.AppDataDirectory returns the same path for me:

C:\Users\*myuser*\AppData\Roaming\User Name\*someid*\Data\

The \Data folder does not even exist in the path and it throws an exception.

@kevinxufei
Copy link

Can repro this issue at Windows platform on the latest 17.10 Preview 7(8.0.40/8.0.20).
Screenshot 2024-05-22 153639

@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels May 22, 2024
@marossi7
Copy link

@kevinxufei the visual studio path example - is the application built as unpackaged ?

@PureWeen PureWeen added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label May 31, 2024
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jun 4, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
6 participants