Alexander Dyagilev
Alexander Dyagilev

Reputation: 1425

LocalAppData folder real and virtualized paths

LocalAppData is virtualized for app converted by Desktop App Converter.

E.g. "real" LocalAppData location is:

C:\Users\user\AppData\Local

While virtualized LocalAppData location is something like:

C:\Users\user\AppData\Local\Packages\MyApp_z4vxg0xscex6e\LocalCache\Local

Questions:

  1. Is there a way to get the path to virtualized folder from DAC converted app (i.e. second "version")?
  2. Is there a way to access non-virtualized LocalAppData folder from DAC converted app?

Upvotes: 4

Views: 1086

Answers (2)

Wade Nielsen
Wade Nielsen

Reputation: 31

I encountered this issue developing a WPF app installed using MSIX.

I was able to resolve this issue by installing "Microsoft.Windows.SDK.Contracts" Nuget Package which gave me access to

Windows.Storage.ApplicationData.Current.LocalCacheFolder

This property provides me with the full non virtualized path.

Useful links:

https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/

UWP app does not copy file to AppData folder

Upvotes: 3

Bogdan Mitrache
Bogdan Mitrache

Reputation: 10993

1) Doesn't using the known folder IDs return you with the correct virtualized path?

2) The following MSDN article has an example of how you can access the non-virtualized folder. Check the article section: What if I need to deploy some files in the installation folder and some others in the AppData folder?

Upvotes: -1

Related Questions