service - Cast Exception When Using Foreach on Microsoft.SharePoint.Client.ListCollection -
i have exhausted resources on issue. i'm hoping can assist me.
i have agent polling microsoft o365 list collections in order walk through lists in given site. here code:
microsoft.sharepoint.client = csom listcollection lists = csom.web.lists; clientcontext.load(lists); clientcontext.executequery(); try { foreach(csom.list list in lists { do.stuff() } } catch(excetion ex) { // excetpion in log @ csom.list after 'in lists' read. /*system.invalidcastexception: unable cast object of type 'system.collections.generic.dictionary`2[system.string,system.object]' type 'microsoft.sharepoint.client.list'.*/ }
when in debug , tracing through code ex appears 'null', still excetion in debug logs when write ex.tostring()
log file. using .net 4.6. code has worked before, during dev tests, wont work running in service. can't find namespace issues. o365 account amusing has 2fa disabled , has admin rights. thoughts helpful. thank you.
Comments
Post a Comment