microsoftgraph/aspnet-snippets-sample

App crashes on File menu with personal account

ne0rrmatrix opened this issue · 2 comments

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:

  • This is not an official Microsoft support channel, and our ability to respond to questions here is limited. Questions about Graph, or questions about adding a new feature to the sample, will be answered on a best-effort basis.
  • Questions should be asked on Stack Overflow.
  • Issues with Microsoft Graph itself should be handled through support.

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';">*@

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.