SAPbobsCOM not working


I developed a web application using C# to place online orders. my app. works fine on SAP server (windows 2008 R2) but when I copied my project to my local machine (runs windows 7) I got an error, can't see the SAPbobsCOM reference. I don't have SAP API DI on my machine
I tried to debug my application in X86 to solve the problem. but no luck. this is the error I got enter image description here

Retrieving the COM class factory for component with CLSID {632F4591-AA62-4219-8FB6-22BCF5F60090} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

thank you

asked on Stack Overflow Mar 24, 2014 by Sam • edited Mar 8, 2018 by Alexander Abakumov

3 Answers


The problem is caused by having Any CPU platform target selected for your app.

This means your app could run as both 32x and x64 process depending on a .NET runtime bitness executing your app. If your process runs as x64 and you have 32x DI API installed (or vice versa), you get this issue, since DI API requires loading native DLLs into your process. However, 32x DLLs couldn't be loaded into a x64 process and vice versa.

That's why we have to explicitly allow the exact same bitness for your app as the DI API bitness it would use.

To do this:

  • first, have SAP DI API (c:\Program Files\SAP\SAP Business One DI API\) and SAP Business One SDK (c:\Program Files (x86)\SAP\SAP Business One SDK\) installed
  • next, figure out which version (x86 or x64) of DI API you have. If it's installed in c:\Program Files - you have x64 version and if it's in c:\Program Files (x86)\ - you have x86 one
  • finally, go to your Project properties -> Build tab and set the same Platform target that your DI SDK version is: enter image description here
answered on Stack Overflow Nov 10, 2016 by Alexander Abakumov • edited Sep 13, 2018 by Alexander Abakumov

I had the exact same issue. My SAP components was running in a WCF service.

To fix the issue changed the application pool to run under 32-bit.

answered on Stack Overflow May 23, 2016 by Ewald

I got the same problem. It was because the SAP Business One references SAPbobsCOM and SBODI_Server were missing. I added these references and it worked. You need to add SAP DI API on your machine for using SAPbobsCOM reference.

answered on Stack Overflow Mar 17, 2015 by Ravi Sharma • edited May 8, 2020 by bluish

User contributions licensed under CC BY-SA 3.0