SOLVED

Can I share documents between apps that have been saved to %AppData% sub folder?

%3CLINGO-SUB%20id%3D%22lingo-sub-1797691%22%20slang%3D%22en-US%22%3ECan%20I%20share%20documents%20between%20apps%20that%20have%20been%20saved%20to%20%25AppData%25%20sub%20folder%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1797691%22%20slang%3D%22en-US%22%3E%3CP%3EAt%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-behind-the-scenes%23common-operations%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMS%20Docs%20-%20Understanding%20how%20packaged%20desktop%20apps%20run%20on%20Windows%20-%20Other%20folders%3C%2FA%3E%20it%20reads%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3ENew%20files%20and%20folders%20created%20under%20the%20following%20directories%20are%20redirected%20to%20a%20per-user%2C%20per-package%20private%20location%3A%3C%2FP%3E%3CUL%3E%3CLI%3ELocal%3C%2FLI%3E%3CLI%3ELocal%5CMicrosoft%3C%2FLI%3E%3CLI%3ERoaming%3C%2FLI%3E%3CLI%3ERoaming%5CMicrosoft%3C%2FLI%3E%3CLI%3ERoaming%5CMicrosoft%5CWindows%5CStart%20Menu%5CPrograms%3C%2FLI%3E%3C%2FUL%3E%3C%2FBLOCKQUOTE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20if%20an%20app%20would%20save%20a%20new%20file%20to%2C%20e.g.%20%3CFONT%20color%3D%22%23993366%22%3E%3CSTRONG%3E%7BAppData%7D%5CRoaming%5C.repos%5CMyProject%5CMain.cs%3C%2FSTRONG%3E%3C%2FFONT%3E%2C%20then%20no%20other%20app%20can%20read%20that%20file%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20again%2C%20files%20saved%20to%20%25AppData%25%20thus%20cannot%20be%20shared%20across%20apps%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20answer%20is%20appreciated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1800999%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20share%20documents%20between%20apps%20that%20have%20been%20saved%20to%20%25AppData%25%20sub%20folder%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1800999%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3EExcellent!%20Thanks%20a%20lot%20for%20your%20very%20informative%20and%20comprehensive%20answer.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wanted%20to%20make%20sure%20if%20I%20got%20it%20right%20and%20needed%20this%20clarification%20for%20me%20understanding%20the%20redirection%20logic.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAppreciate%20your%20great%20clarification!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%2C%3C%2FP%3E%3CP%3EAxel%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

At MS Docs - Understanding how packaged desktop apps run on Windows - Other folders it reads:

 

New files and folders created under the following directories are redirected to a per-user, per-package private location:

  • Local
  • Local\Microsoft
  • Roaming
  • Roaming\Microsoft
  • Roaming\Microsoft\Windows\Start Menu\Programs

 

So, if an app would save a new file to, e.g. {AppData}\Roaming\.repos\MyProject\Main.cs, then no other app can read that file?

 

Then again, files saved to %AppData% thus cannot be shared across apps?

 

Your answer is appreciated.

2 Replies
best response confirmed by BetterToday (Occasional Contributor)
Solution

@BetterToday  It is technically possible for the other app to find the file by knowing the package family name of the package that created the file, but if you expect and end-user to browse to that location it is not likely to be acceptable by them.

 

You would be better off in using a different common area for storage of cross-app shared files that is not subject to redirection.  While the Documents folder is a common approach, you gave a coding file as an example; so you might want to try elsewhere.  For example, directly in the user profile ("C:\users\username\repos") should work and avoid the redirection (as long as you keep that folder out of the package).

@TIMOTHY MANGANExcellent! Thanks a lot for your very informative and comprehensive answer.

 

I wanted to make sure if I got it right and needed this clarification for me understanding the redirection logic.

 

Appreciate your great clarification!

 

Cheers,

Axel