on 2019 Jun 26 12:52 PM
In one project at the company I work with, we have a server application written in C#, targeting .NET Core 2.2. This application now has to access data an existing database which belongs to an existing installation of SAP B1, which used by our customer. The preferred way to do that seems to be via the DI API.
Our customer provided us with installation files for both the DI API and the SAP B1 SDK and has already obtained a license for one program. It would be preferable to run our server application on a different physical server (than the one the B1 and the database are running on). Both servers are running on Windows Server 2012 and are maintained by our customer. I am currently trying to get a development environment working on our own server, running Windows Server 2016.
There are two issues with trying to get this setup working, the second of which may very well be the reason for the first:
* The SDK is installed on our development server and we can reference SAPbobsCOM from the library SAPBusinessOneSDK.dll and access some static properties (for example the enum SAPbobsCOM.BoDurations.du_Days). But as soon as we instantiate the Company object (i.e., SAPbobsCOM.Company c = new SAPbobsCOM.Company(); ) the application crashes at precisely that line. Debugging reveals a System.Runtime.InteropServices.COMException (0x80040154): 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)). The same occurs when running a compiled test program on the customer's target server (the one NOT running SAP B1).
* Installing the DI API on our development server fails altogether. The error message says: "Installation will be terminated; installation of project prerequisites do not exist in their correct location". The last line in the log file created by the setup says: "ERROR: Prerequisites installation failed with return value : 1603"
It seems obvious that something is not installed / set up correctly. As the documentation provided by SAP is net very explicit on how to set up such an application, we are currently stuck on how to get database access working.
A note on the side:
It wouldn't be impossible to get access to the server running the B1 and to run our server application there. Yet (if it can be achieved) we would prefer to have our server application running on dedicated server, as described above.
So the question is: How to set this up correctly?
More precisely: How to install the DI API? How is the first problem presumably related to the second and if it isn't: How to solve the first one? Is it (as documentation and code examples by SAP suggest) even possible to run the an application that uses the DI API on a different physical server than the one the B1 is running on?
Any advice would be appreciated!
Request clarification before answering.
I know this is an old query, however, I had the same error and realized it happened when I instantiated the variable that is to contain Company without an initialization value.
public static SAPbobsCOM.Company? oCom;
this generated the error that you indicate, and it was solved with this variable initialization.
public static SAPbobsCOM.Company? oCom = null;
is the only thing that was needed in my case.
Regards
Santiago M.
P.S.: this was translated, my native language is Spanish.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 27 | |
| 13 | |
| 11 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.