Skip to content

Error "Could not load file or assembly" for OneDriveService.Instance.RootFolderForMeAsync() #3097

Open
@zipswich

Description

@zipswich

Describe the bug

The following code had been working flawlessly for about 2 years until today when I updated a bunch of NuGet packages:
oneDriveRootFolder = await OneDriveService.Instance.RootFolderForMeAsync();
Now, it throws the following exception:

Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.13.7.964, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

   at Microsoft.Toolkit.Services.MicrosoftGraph.MicrosoftGraphService.<LoginAsync>d__54.MoveNext()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.Toolkit.Services.MicrosoftGraph.MicrosoftGraphService.LoginAsync(String loginHint)
   at Microsoft.Toolkit.Services.OneDrive.OneDriveService.<LoginAsync>d__32.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Toolkit.Services.OneDrive.OneDriveService.<RootFolderForMeAsync>d__33.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

I understand OneDriveService is obsolete. Is this expected? I would love to have it working now while preparing to use Graph SDK to replace it.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

Steps to reproduce the behavior:
OneDriveService.ServicePlatformInitializer = new OneDriveServicePlatformInitializer();
OneDriveService.Instance.Initialize(App.ClientId, new string[] { "Files.ReadWrite.All" });
OneDriveStorageFolder oneDriveRootFolder = await OneDriveService.Instance.RootFolderForMeAsync();

Expected behavior

No error.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

NuGet Package(s): 
![image](https://user-images.githubusercontent.com/6095671/72170648-36c63f00-339f-11ea-9210-a6d8af705e16.png)

Package Version(s): 
6.0.0

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [x] May 2019 Update (18362)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [x] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: ) 
- [ ] 2019 Preview (version: )

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bug 🐛An unexpected issue that highlights incorrect behaviordocumentation 📃

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions