none
System.MethodAccess Exception RRS feed

  • Question

  • We have an application, Webforms site, which talks to Azure Table storage. A few months ago, the original table storage libraries were upgraded to use the newer Microsoft.Azure.CosmosDB.Table , all was well. Last week, in NuGet package manager we saw the following: 

    "NOTE: This .NET Framework library is in maintenance mode and it will be deprecated soon. Please upgrade to the new .NET Standard library (https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Table) to continue to get the latest features supported."

    We obediently changed the package to use Microsoft.Azure.Cosmos.Table, various other libraries were also upgraded by nuget. it all compiles, but when it runs, on CloudTable.CreateIfNotExists it throws the following exception:

    System.MethodAccessException
      HResult=0x80131510
      Message=Attempt by method 'Microsoft.Azure.Cosmos.Table.Logger.LogInformational(Microsoft.Azure.Cosmos.Table.OperationContext, System.String, System.Object[])' to access method 'Microsoft.Azure.Documents.DefaultTrace.TraceInformation(System.String)' failed.
      Source=Microsoft.Azure.Cosmos.Table

    Tried to revert to Microsoft.Azure.CosmosDB.Table, but it cant find a suitable version of Microsoft.Azure.Storage.Common

    Any suggestions before we undo the "upgrade" in source control and go back to a soon-to-be-deprecated library?

    Wednesday, July 10, 2019 4:16 PM

All replies

  • Hi LegacyOfHerot, 

    Thank you for posting here.

    According to your question, your issue is more related to  ASP.NET. Therefore, it will be more appropriate to ask your question in Web Forms or Azure and ASP.NET forum.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework.

    Thank you for your understanding.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by DongheXu Tuesday, August 6, 2019 5:55 PM
    • Unproposed as answer by DongheXu Tuesday, August 6, 2019 5:55 PM
    Thursday, July 11, 2019 9:13 AM
  • You are correct in that this problem appears in an asp.net application, the unit test does not raise the exception, it therefore suggests a Code Access Security issue, I tries setting the trust level for the web app to Full - in web.config, no help.

    I was hoping someone in CLR land might shine some light. 

    Thursday, July 11, 2019 12:25 PM
  • Exactly same issue here. Same error shows up in .net WebApi as well as in Azure Cloud Service Worker role. Both apps are .net 4.7.2
    Sunday, July 14, 2019 5:43 PM
  • Was able to fix by downgrading only Microsoft.Azure.DocumentDB.Core from 2.5.1 to prior version 2.4.2. All other nuget packages were kept at latest versions. I was not able to downgrade with Visual studio GUI and kept getting error "Found invalid data while decoding." I ended up updating the project files / packages.config by hand (only changing 2.5.1 to 2.4.2). Hope this helps.
    • Proposed as answer by DongheXu Tuesday, August 6, 2019 5:55 PM
    Monday, July 15, 2019 2:10 AM