PDM addin error code 0x080131513

Hello all,

I create an PDM addin for a customer which handles a post state event.

It runs fine within Windows Explorer. But when making transitions from the SolidWorks UI, some users get this error when the function is called:

image

Since this handles a post event, everything in PDM is fine. But it’s just annoying.

The function I call is from another DLL as the one that’s used by PDM. Could that have something to do with it?

Thanks in advance for your reaction!

JJ

Potential uncaught unhandled exceptions/references issue. Dude you should start using: PDMFramework

Check out the example folder in the repo.

This was something I also thought of, so I checked for unhandled exceptions.

1 Like

Let me know if you need some help debugging it!

Have you checked for exceptions that aren’t caught by default? Dotnet has a few and they’re meant to crash your app. Solidworks throws them every now and then but I run into them at a few places and was able to recover.

1 Like

@PeterBrinkhuis @JJZ

I have had these issues happen to me with SW and PDM:

  • I’m using different versions of the SW and/or PDM references in different projects.
  • Add-in fails to resolve references (because they are not loaded into the appdomain).
  • Embed Interop Types = true (This should always be set to false)
  • There is reference with a COM component that needs to be loaded during runtime (For PDM)
  • I’m using different versions of unsigned references.
1 Like

Thanks guys, this Friday I’ll be at the customer and try to solve it. It seems like I already took your suggestions into account (if applicable). I have some options to check. Strange is that the error didn’t appear when I tested the add-in when I was on site.

I just checked my VS project properties and found that ‘auto-generate binding redirects’ is turned off. Should I turn this on?

Further more, ‘platform target’ is set to ‘any CPU’. Would x64 be a better option?

Any CPU.
You can leave binding as is.