none
Type Library dll generating "System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt" RRS feed

  • Question

  • Hello there,

    I'm facing this exception -
    System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt

    This is with a COM interop (dll). I'm face this problem when I deploy the application. On local PC when I run web application in Visual Studio 2008 everything works fine. However when I deploy/publish the application then on that PC I get this exception. What could be wrong?

    Could you please help me in resolving this?

    Thanks in advance.


    Regards, Paras @ ISRC
    • Moved by Leo Liu - MSFT Tuesday, May 10, 2011 3:47 AM Moved for better support. (From:Visual C# General)
    Friday, May 6, 2011 9:32 AM

Answers

  • Finally, I was able to resolve this issue.

     

    The COM component was compiled on PC1 and PC2 (both were same).  In my web application on local PC I used PC1 COM component and on deployment PC there was PC2 COM component. (Exactly same size. I was remembering the dates which helped to differentiate between two).

    I don't understand why it should have problem. Though when I de-register & then re-registered PC1 COM component & restarted IIS each time, problem was resolved.

     

    Another reason was the COM component was expected a text file in certain folder and there was no proper exception management inside COM component which can highlight this error. “DebugView.exe” was very helpful in investigating this.

     

    After these two things, I got rid of this problem.

     

    Thanks to all who responded to this post. Thank you for providing your valuable time and suggestions.


    Regards, Paras @ ISRC
    • Marked as answer by Paras7Star Wednesday, May 11, 2011 10:42 AM
    Wednesday, May 11, 2011 10:42 AM

All replies