Vague
Vague

Reputation: 2280

UWP ApplicationData.Current.LocalFolder is null in release

I have this code in startup for a UWP app to access local data

StorageFolder appDataFolder = Windows.Storage.ApplicationData.Current.LocalFolder;

This works fine in debug but appDataFolder is null in release mode.

Why is this so? How do I access local data in release mode?

Upvotes: 0

Views: 518

Answers (1)

Vague
Vague

Reputation: 2280

I got the answer from UWP run in Release Mode gives “'ApplicationData' does not exist in the current context” To run in release mode, in properties/debug uncheck Net Native tool chain and uncheck Optimize codeenter image description here

Upvotes: 1

Related Questions