Getting this error "An exception of type 'Microsoft.OneDrive.Sdk.OneDriveException' occurred in mscorlib.dll but was not handled in user code" in below code...
I am building a console App...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.ActiveDirectory.GraphClient;
using Microsoft.Azure.ActiveDirectory.GraphClient.Extensions;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.OneDrive.Sdk;
You are calling an async method in Main() without telling that method to run synchronously. The SDK is not compatible with that. Try checking out this StackOverflow thread about the topic.
Getting this error "An exception of type 'Microsoft.OneDrive.Sdk.OneDriveException' occurred in mscorlib.dll but was not handled in user code" in below code... I am building a console App...
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Azure.ActiveDirectory.GraphClient; using Microsoft.Azure.ActiveDirectory.GraphClient.Extensions; using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.OneDrive.Sdk;
namespace samplapp { class Program { private static string clientId = "ca***_24"; private static string returnUrl = "http://localhost:8080/a**__gin"; private static string[] scopes = new String [] {"Files.Read", "Files.Read.All", "Files.Read.Selected", "Files.ReadWrite", "Files.ReadWrite.All", "Files.ReadWrite.AppFolder", "Files.ReadWrite.Selected", "Group.Read.All", "Group.ReadWrite.All", "IdentityRiskEvent.Read.All", "MyFiles.Read", "MyFiles.Write", "Sites.Read.All", "Sites.Search.All" }; private static string clientSecret = "eIjIywbe_*WyfCa"; private static string oneDriveApiEndpoint = "https://co******_s-my.sharepoint.com/api/v2.0/me/"; private static string serviceResourceId = "https://co*******s-my.sharepoint.com"; static void Main(string[] args) {
}
Can you please help me on this?