tag:blogger.com,1999:blog-9049032025342264339.post3790132165843869585..comments2024-03-28T16:14:22.719+03:00Comments on sadomovalex's blog: BadImageFormatException when call virtual methods from SPSecurity.RunWithElevatedPrivilegesAlexey Sadomovhttp://www.blogger.com/profile/18112105989691733410noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-9049032025342264339.post-18894856995359972722012-01-22T15:15:56.386+04:002012-01-22T15:15:56.386+04:00Hi Lionel,
thank you for this link, seems like thi...Hi Lionel,<br />thank you for this link, seems like this is compiler problem (not Sharepoint). About helper method - yes I know this workaround, this is how I found the problem. I had 2 methods in the class (GetAll() and GetAll(categoryName)), second method called first method. SPSecurity.RunWithElevatedPrivileges() was in 2nd method and it worked. But when I moved it to the 1st parameterless Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-88230012702223418052012-01-22T01:34:36.121+04:002012-01-22T01:34:36.121+04:00Hi alex
Your issue is you try to use base keyword ...Hi alex<br />Your issue is you try to use base keyword into an anonymous method (the on given to RunWithElevatedPrivilege method).<br />The compiler make this into an anonymous class containing your code with base that as non sense into this newly class...<br />Because I've a poor english you must look at this article that explain the same issue without Sharepoint into scope : http://Lionel Limozinhttps://www.blogger.com/profile/17692630326499411552noreply@blogger.com