I'm trying to work with Microsoft's Graph API at my company, and I'm following the online documentation to get this done. I'm working in VB .NET and I am importing the Microsoft.Graph.Auth package as it says, and when I build the code, I get the error above. Please see screenshot below too.
I'm unable to find a solution for this online. I cannot tell if it's something to do with the fact that it's a preview package? It's strange since this is what Microsoft instructs us to do...
Imports Microsoft.Identity.Client
Imports Microsoft.Graph
Imports Microsoft.Graph.Auth
Public Class Graph
Private clientId As String = System.Configuration.ConfigurationManager.AppSettings("GraphClientId")
Private redirectUri As String = System.Configuration.ConfigurationManager.AppSettings("RedirectUri")
Shared tenantID As String = System.Configuration.ConfigurationManager.AppSettings("GraphTenant")
Private clientSecret As String = System.Configuration.ConfigurationManager.AppSettings("GraphSecret")
Public authProvider As ClientCredentialProvider = Nothing
Public Sub Initialize()
Dim confidentialClientApplication As IConfidentialClientApplication = ConfidentialClientApplicationBuilder.Create(clientId).WithTenantId(tenantID).WithClientSecret(clientSecret).Build()
authProvider = New ClientCredentialProvider(confidentialClientApplication)
End Sub
Public Sub GetAllUserTasks()
Initialize()
Dim graphClient As New GraphServiceClient(authProvider)
Dim tasks = graphClient.[Me].Planner.Tasks.Request().GetAsync()
Debug.Print(tasks.Result.Item(0).Title)
End Sub
End Class
Would greatly appreciate the help!