Frequent errors with 2009 API

Our company is currently writing an add-in for SolidWorksEnterprise PDM but we keep encountering the same problem. All ourcode is in VB.NET with the Framework 2.0. When we call somefunctions from the EPDM API, we sometimes get a "System.AccessViolationException: Attempted to read or writeprotected memory. This is often an indication that other memory iscorrupt." exception.

Specifically, we mostly get this error when we try to read the BoMfrom a file with theGetComputedBOM function or when we try to access thevariables with theGetVariable function from aIEdmVariableMgr6 object. The error is not consistent,sometimes the call to the functions will work and sometimes we willget an exception or the underlying process will simply crash withno exception thrown. We get the same problem with a simple customapplication that reads the BoM of a chosen file.

When doing the tests, we were logged with the admin account on theEPDM vault and with an account on the computer with admin rights.We also seems to encounter the problem mostly when using aSolidWorks assembly file when trying to read the BoM or variables.

Anyone got any idea what would be causing this?
SolidworksSolidworks Pdm enterprise Pdm