AccessViolationException : Catch/Finally block fails to Execute

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am developing an Add-on for Revit Structure 2012 that needs displaying the ThumbNail's of the RFA.
Few of the RFA's have the preview available and few don't(I'm dislaying a default Image for these) After deploying, it fails to run on one of the machines and displays the below error
"Revit encountered a System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
I implemented the try/Catch/Finally approach to log the errors.. but to my surprise found that the Catch block fails to execute and also the finally block on that machine.
I tried building a standalone version of this application and found that all works well.
The execution fails when I integrate this into Revit.. Any advice is really appreciated...
Thanks