我的 UWP 应用使用应用文件夹 (Files.ReadWrite.AppFolder) 在 OneDrive 上存储应用数据.我升级了应用程序以使用 Microsoft Graph SDK 而不是旧的 OneDrive SDK(版本 1.x).
My UWP app uses app folder (Files.ReadWrite.AppFolder) for storing app data on OneDrive. I upgraded the app to use Microsoft Graph SDK instead of the old OneDrive SDK (version 1.x).
我没有使用在 apps.dev 中注册的旧客户端 ID 进行身份验证.microsoft,所以我在 aad.portal.azure 中注册了我的应用/,我使用 MSAL.NET 进行身份验证.
I didn't get the authentication to work using the old client id registered in apps.dev.microsoft, so I registered my app in aad.portal.azure/ and I use MSAL.NET for authentication.
问题是升级后的应用在 OneDrive(我的应用 1)上创建了一个新的应用文件夹,而不是使用旧的和现有的应用文件夹(我的应用).这会导致用户在升级到此新版本时丢失数据.
The problem is that the upgraded app creates a new app folder on OneDrive (My App 1) instead of using the old and existing app folder (My App). This would result users loosing their data when they upgrade to this new version.
我应该怎么做才能让升级后的应用访问现有的应用文件夹而不是创建新的应用文件夹?
What should I do to make the upgraded app access the existing app folder and not to create a new one?
推荐答案不可能,app 文件夹链接到应用程序的 id.如果您切换应用 ID,您将无法访问之前的文件夹.
It isn't possible, the app folder is linked to the application's id. If you switch your App Id, you will lose access to the previous folder.
您真正需要做的是更新您之前的应用注册,并使用它来对 Graph 进行身份验证.
What you really need to do is update your previous app registration and use that to authenticate against Graph.
更多推荐
如何从 OneDrive SDK 升级到 Microsoft Graph SDK 并保留旧的 AppFolder
发布评论