microsoftgraph / aspnet-snippets-sample

A repository of code snippets that use Microsoft Graph to perform common tasks such as sending email, managing groups, and other activities from an ASP.NET Core MVC app. This sample uses the Microsoft Graph .NET Client Library to work with data, and the Microsoft Identity Web Library for authentication on the Microsoft identity platform v2.0 endpoint.
MIT License
189 stars 101 forks source link

App crashes on File menu with personal account #65

Closed ne0rrmatrix closed 3 years ago

ne0rrmatrix commented 3 years ago

Can the sample application access files on personal account? I have posted a question on stack overflow regardin errors tryin to access files. Everything in app works well for personal login except app crashes on attempt to access any item on file menu? Should file menu be accessible from personal account? Do i need to set delegate permissions for this? I have set them after getting error and seeing the app asks for them in the code. I have been unable to use the file menu as app crashes when trying to load any of the menu choices under file menu. I would like to find out if this is user/dev error on my part when using sample as i followed the directions for using it explicitly and only deviated by adding extra permissions after it crashed on attempt to access file menu.

Thank you for taking an interest in Microsoft Graph development! Please feel free to ask a question here, but keep in mind the following:

ne0rrmatrix commented 3 years ago

Found a fix. If you are logging in with personal account comment out following code in _FileListPartial.cshtml and it works as itended;

  @*  <img src="@file.Thumbnails.CurrentPage.First().Small.Url" onerror="this.src='/img/no-profile-photo.png';">*@
jasonjoh commented 3 years ago

Thanks for reporting. I'll see if I can reproduce the error and implement a fix so you don't have to modify the code for personal accounts.