huysentruitw / SapNwRfc

SAP NetWeaver RFC library for .NET 5, .NET Core and .NET Framework
MIT License
148 stars 43 forks source link

SapConnection connect issues #5

Closed lastingyeh closed 4 years ago

lastingyeh commented 4 years ago

Hi huysentruitw

As issues below

Could not open the ICU common library. The following files must be in the path described by the environment variable "PATH": icuuc50.dll, icudt50.dll, icuin50.dll [D:/depot/bas/753_REL/src/flat/nlsui0.c 662] pid = 25568

Thanks.

huysentruitw commented 4 years ago

Hi @lastingyeh, you will get this error when this SapNwRfc library cannot find the SAP Netweaver DLL's. These are not included in this NuGet package because of licencing restrictions, so you'll have to get them yourself from SAP directly.

This is explained here

lastingyeh commented 4 years ago

Thanks for your reply. As I create .Net Core ASP.net API project, and add reference 'sapnwrfc.dll' along with icuuc50.dll, icudt50.dll, icuin50.dll at /bin folder after I also download the SAP libs from sap sdk. Now I got the messagebox 'Could not open the ICU common library', so may you have recommend how to put the .dll files at project.

Thanks again.

huysentruitw commented 4 years ago

The steps you could follow are:

  1. Install my NuGet package using the package manager: PM> Install-Package SapNwRfc
  2. Copy the SAP dll's to the directory of your csproj
  3. Add the SAP dll's to your project in visual studio and set the "Copy to Ouput Directory" setting in the Visual Studio Solution Exporer to "Copy When Newer" for all DLL files.

Another options is, like the first error message suggests, extract the SAP dll's to a folder on your computer (f.e. C:\sap) and add the path to the place where the DLL's are located to you systems PATH envirmonment variable (this path should be something like: C:\sap\nwrfcsdk\lib).

If it doesn't work, maybe we can arrange a short call to get you up and running.

lastingyeh commented 4 years ago

I'm so appreciate with your detailed response, and try to implement it before reply.

Thanks a lot.

lastingyeh commented 4 years ago

Hi huysentruitw, I retry the above methods. but it always have error, and generate the file 'dev_rfc.log' as content:

**** Log file opened at 2020-06-29 08:47:24.369767 UTC+08:00 (¥x¥_¼Ð·Ç®É¶¡), Encoding UTF-8 NW RFC Library: SDK variant, Release 750 Patch Level 6, Compiled on Feb 5 2020 20:20:33 CPIC library: 753.2019.10.14 version 3, NI library: 40, Kernel Release: 753 Patch Level 525 Current working directory: D:\Workspaces\codes\WebAPICores\WebAPICores, Program: iisexpress Hardware: PC with Windows NT 8x AMD64 Level 6 (Mod 142 Step 12), Operating_system: Windows NT 10.0 Hostname: xxxx, IP address: xxxxx, IPv6 address:xxxxx

2020-06-29 08:47:24.369914 [13580] >> Info entry Did find config file D:\Workspaces\codes\WebAPICores\WebAPICores\sapnwrfc.ini.

thanks.

huysentruitw commented 4 years ago

The messages in your last comment don't really sound like an error anymore. Are you still getting the exception: The SAP RFC libraries were not found in the output folder or in a folder contained in the systems PATH environment variable. ?

In which timezone are you?

lastingyeh commented 4 years ago

Dear huysentruitw, As I want to deploy to Azure App Service. May you have any recommendation with it, like as environment variables settings and references added...etc.

I'm so grateful with your patience. Thanks a lot.
huysentruitw commented 4 years ago

Do you already have it working locally (on your computer) ?

lastingyeh commented 4 years ago

Dear huysentruitw,

I had ever get work it successfully. When I try to remove all related references that try to find the logic, then it still work. So may you have any idea about 'sapnwrfc.dll' interact with application?

Thanks.

lastingyeh commented 4 years ago

Dear huysentruitw,

The issues 'Could not open the ICU common library' screens' url, please see it.
https://github.com/lastingyeh/sap-issues

Thanks.

lastingyeh commented 4 years ago

Hi huysentruitw,

 I put all dll's at external env path, and reference at existed PATH folder but not add new file folder. It worked well for me now.  

But I have a question with SAPConnectionString at your README.md example as  'AppServerHost=MY_SERVER_HOST; SystemNumber=00; User=MY_SAP_USER; Password=SECRET; Client=100; Language=EN; PoolSize=5; Trace=8'. The value of Trace is 8 but I find it from https://help.sap.com/viewer/753088fc00704d0a80e7fbd6803c8adb/7.5.9/en-US/48a88d7f5134307de10000000a42189b.html, I got find the Trace value between 0 and 3. 

I'm grateful with your help.

Thanks.

huysentruitw commented 4 years ago

Yes trace should be set to 3 at most.

Since it seems to be working now, I will close this issue. Feel free to open a new issue when you're having problems with this library. Regards, Wouter