Upgrade to .Net 7 gets me an MS Graph Error: Method not found: 'Microsoft.Graph.IDriveItemCreateLinkRequestBuilder

96 views Asked by At

I upgraded our .Net Core web application to .Net 7. Everything went pretty smooth for the most part. The solution built successfully, but we all know that doesn't mean everything will work. My application collects files from a SharePoint folder using Microsoft Graph. When it collects these files, it creates a link to the file. I am getting the following exception, which it looks lik it's related to the link.

Method not found: 'Microsoft.Graph.IDriveItemCreateLinkRequestBuilder Microsoft.Graph.IDriveItemRequestBuilder.CreateLink(System.String, System.String, System.Nullable`1<System.DateTimeOffset>, System.String, System.String)'.

I tried to google this one and could not find anything, except a possible licensing issue under a link from Microsoft. That known issue doesn't seem to be related. Anyone got any ideas?

UPDATE: Someone asked which version of Graph I'm using and for a code sample. I am currently using MS Graph 4.11.0. The link code is below:

var link = await _graphServiceClient.Sites[siteId].Drives[docFolderId].Items[file.Id].CreateLink("edit", "organization").Request().PostAsync();
formfile.FileLink = link.Link.WebUrl;

Hope this helps!

0

There are 0 answers