这个问题让我困惑了几天,当代码运行到
await ApplicationData.Current.LocalFolder.GetFileAsync(udFileName);
该应用程序总是跳转到
UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
        };
异常e是:</p>
{Windows.UI.Xaml.UnhandledExceptionEventArgs}
Exception   {"Object reference not set to an instance of an object."}   
System.Exception {System.NullReferenceException}
Message "System.NullReferenceException.......
以下是我调用的函数:
public async void RestoreUserDefaults()
    {
        string udFileName = "userdefaults.udef";
        bool bExist = true;
        {
            try
            {
                await ApplicationData.Current.LocalFolder.GetFileAsync(udFileName);
            }
            catch (FileNotFoundException)
            {
                bExist = false;
            }
        }
    }
我已将文件类型添加到 package.appxmanifest。
任何人都可以帮助我,非常感谢......