Topic
  • 49 replies
  • Latest Post - ‏2019-03-14T08:12:05Z by RadhikaG
vish2017
vish2017
47 Posts

Pinned topic Discussions: IBM Data Server Provider (Beta) support for .NET Core

‏2017-02-15T06:55:53Z | .net core ibm

This topic is for discussing features/clarifications related to IBM Data Server Provider (Beta) support for .NET Core.

  • alexanderkeenan
    alexanderkeenan
    1 Post

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-02-16T04:55:46Z  

    IBM Data Server Provider (Beta) support for .NET Core
    Can I access DB2 tables on mainframe without going through CICS?

     

  • vish2017
    vish2017
    47 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-02-16T11:13:59Z  

    IBM Data Server Provider (Beta) support for .NET Core
    Can I access DB2 tables on mainframe without going through CICS?

     

    Yes, using the Provider you can connect to mainframe directly provided you have the DB2Connect license.
    DB2Connect provides connectivity to mainframe and midrange databases from Linux, UNIX, and Windows operating systems.

  • Þór Adam
    Þór Adam
    1 Post

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-02-16T13:14:36Z  

    Can you also support the regular .Net platform with the IBM.EntityFrameworkCore package? Or do you intend to update EntityFramework.IBMDataServer?

    Microsoft.EntityFrameworkCore.Relational supports both platforms:
    .NETFramework,Version=v4.5.1
    .NetStandard,Version=v1.3

  • vish2017
    vish2017
    47 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-02-17T12:14:56Z  

    Can you also support the regular .Net platform with the IBM.EntityFrameworkCore package? Or do you intend to update EntityFramework.IBMDataServer?

    Microsoft.EntityFrameworkCore.Relational supports both platforms:
    .NETFramework,Version=v4.5.1
    .NetStandard,Version=v1.3

    this provider is targeted for .NET Core and regular .NET framework support is not provided in this release. We may change that in near future and provide regular .NET support. We will update you if there are any such plans. EntityFramework.IBMDataServer may not be enhanced any more and all future .NET Core related support will be through these Providers only.

     

  • Kappas
    Kappas
    23 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-02-20T06:48:40Z  

    Hello,

     

    Is there going to be full support for code first with migrations ?

     

    Br,

    Kappas

  • vish2017
    vish2017
    47 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-02-20T14:24:11Z  
    • Kappas
    • ‏2017-02-20T06:48:40Z

    Hello,

     

    Is there going to be full support for code first with migrations ?

     

    Br,

    Kappas

    creating the database objects from EntityFramework is not supported and the EF Provider can be used to work with existing database objects.

     

    Thanks
     

  • Kappas
    Kappas
    23 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-02-28T06:41:15Z  

    What is your recommended deployment model in old fashion on-premises Windows server for IBM.Data.DB2.Core package ?

     

    It has over 100Mb of files so its not feasible to include it into application folder if its shared anyways via environment variable.

     

    I havent studied newest nuget features but is there some kind of global install like in NPM -g ? So that every server needs only global install for IBM.Data.DB2.Core and modification to PATH.

     

    Additional idea: Could this be handled with Chocolatey ? Checked that IBM does not have any official packages in there yet..

     

    Is there need for versioning for those fles under clidriver-folder ? How is that handled?

     

    With containers this is not gonna be problem but with old deployment model it seems to be...or it needs some manual tweaking when deploying

    Br,

    Kappas

    Updated on 2017-02-28T06:49:07Z at 2017-02-28T06:49:07Z by Kappas
  • vish2017
    vish2017
    47 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-03-01T06:32:53Z  
    • Kappas
    • ‏2017-02-28T06:41:15Z

    What is your recommended deployment model in old fashion on-premises Windows server for IBM.Data.DB2.Core package ?

     

    It has over 100Mb of files so its not feasible to include it into application folder if its shared anyways via environment variable.

     

    I havent studied newest nuget features but is there some kind of global install like in NPM -g ? So that every server needs only global install for IBM.Data.DB2.Core and modification to PATH.

     

    Additional idea: Could this be handled with Chocolatey ? Checked that IBM does not have any official packages in there yet..

     

    Is there need for versioning for those fles under clidriver-folder ? How is that handled?

     

    With containers this is not gonna be problem but with old deployment model it seems to be...or it needs some manual tweaking when deploying

    Br,

    Kappas

    Hi,

     thanks for bringing up some interesting questions. I will try to share how we want to address some of the points you mentioned. My response is in the same order as your queries.

     

    Deployment is mostly in line with Microsoft approach where in no installation is needed and its more like a bin deployment. So each of the applications will have the packages it needs. Size may be an issue here but we have not yet identified any alternatives to that.

     

    In terms of size, we are aware of the bigger footprint of this driver compared to other NuGet package drivers. We are trying ways to reduce the impact and in future we may try to reduce the size. We may also break this one package into multiple so that only the delta will be downloaded.

     

    I checked NuGet again and the old decision stays and there is no global installation available like NPM -g.

     

    We have not  thought about having our package on Chocolatey.  We will explore it further to if it helps to solve the global installation problem.

     

    Regarding clidriver versioning, currently the package is tied to a particular version but in future we will modify it to make sure different versions can co exist and the packages can pick their corresponding clidrivers. We are aware of the issue involved here and are working on it.

     

  • Resiban
    Resiban
    2 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-04-12T10:32:38Z  

    Hi, we are trying to implement the IBM.Data.DB2.Core package and it works fine when executed form Visual Studio 2017.

    However, when we try to publish the solution we always get the error "'AnyCPU' platform is not supported.  Project platform must be either x86 or x64".

    We have already removed the AnyCPU configuration both from Debug and Release profiles:

    GlobalSection(SolutionConfigurationPlatforms) = preSolution
     Debug|x64 = Debug|x64
     Release|x64 = Release|x64
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
     {4B0BC6EE-6251-4341-9A8A-E4B6E3FFC9B7}.Debug|x64.ActiveCfg = Debug|x64
     {4B0BC6EE-6251-4341-9A8A-E4B6E3FFC9B7}.Debug|x64.Build.0 = Debug|x64
     {4B0BC6EE-6251-4341-9A8A-E4B6E3FFC9B7}.Release|x64.ActiveCfg = Release|x64
     {4B0BC6EE-6251-4341-9A8A-E4B6E3FFC9B7}.Release|x64.Build.0 = Release|x64
    EndGlobalSection

     

     

     

    Also, I had to uninstall the IBM Data Server Client package to make it work (I was getting an AccessViolationException). Since the application is going to connnect to DB2 for z/OS, the server has a DB2Connect installed. Will it have incompatibility issues as I had them on my machine?

     

    Thank you

     

    Updated on 2017-04-12T10:36:29Z at 2017-04-12T10:36:29Z by Resiban
  • vish2017
    vish2017
    47 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-04-14T03:31:05Z  
    • Resiban
    • ‏2017-04-12T10:32:38Z

    Hi, we are trying to implement the IBM.Data.DB2.Core package and it works fine when executed form Visual Studio 2017.

    However, when we try to publish the solution we always get the error "'AnyCPU' platform is not supported.  Project platform must be either x86 or x64".

    We have already removed the AnyCPU configuration both from Debug and Release profiles:

    GlobalSection(SolutionConfigurationPlatforms) = preSolution
     Debug|x64 = Debug|x64
     Release|x64 = Release|x64
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
     {4B0BC6EE-6251-4341-9A8A-E4B6E3FFC9B7}.Debug|x64.ActiveCfg = Debug|x64
     {4B0BC6EE-6251-4341-9A8A-E4B6E3FFC9B7}.Debug|x64.Build.0 = Debug|x64
     {4B0BC6EE-6251-4341-9A8A-E4B6E3FFC9B7}.Release|x64.ActiveCfg = Release|x64
     {4B0BC6EE-6251-4341-9A8A-E4B6E3FFC9B7}.Release|x64.Build.0 = Release|x64
    EndGlobalSection

     

     

     

    Also, I had to uninstall the IBM Data Server Client package to make it work (I was getting an AccessViolationException). Since the application is going to connnect to DB2 for z/OS, the server has a DB2Connect installed. Will it have incompatibility issues as I had them on my machine?

     

    Thank you

     

    Hi,

    we are able to reproduce the issue in our environment also. We will provide an update if there are any workarounds. Otherwise you may have to wait for the next version of the package. The date of the next package upload is not yet finalized.

     

    Along with Publishing of your application what else you do in terms of deployment? Just curious to know more about your usage scenarios.

     

    Thanks and regards

    Vishwa
     

  • Resiban
    Resiban
    2 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-04-14T05:36:41Z  
    • vish2017
    • ‏2017-04-14T03:31:05Z

    Hi,

    we are able to reproduce the issue in our environment also. We will provide an update if there are any workarounds. Otherwise you may have to wait for the next version of the package. The date of the next package upload is not yet finalized.

     

    Along with Publishing of your application what else you do in terms of deployment? Just curious to know more about your usage scenarios.

     

    Thanks and regards

    Vishwa
     

    Hi,

    our deployment process is actually very simple, because all our customers (banks) require is usually a zipped archive of the published project.

    Then each one has a different process of deployment on their servers, but it does not affect us, for now.

     

    Anyway, as a work-around I deleted the condition in the IBM.Data.DB2.Core.targets file while maintaining x64 as the target cpu and it worked.

     

    The actual issue that is preventing us to use the new library is the fact that it is incompatible with all other drivers currently installed on the machine.

    On our development PCs we have the IBM Data Server Client, on our test server we have an instance of IBM DB2 Express-C, and on the customer server we have the DB2 Connect installed.

    All these installations are required in other older projects, so this means that until they are mutually exclusive there is no way fo start implementing the IBM.Data.DB2.Core package.

    At the moment we are relying on the full framework and the unofficial package of IBM.Data.DB2 10.0.0.5.

     

     

  • NuckingFuts
    NuckingFuts
    13 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-04-14T17:29:57Z  
    • Resiban
    • ‏2017-04-14T05:36:41Z

    Hi,

    our deployment process is actually very simple, because all our customers (banks) require is usually a zipped archive of the published project.

    Then each one has a different process of deployment on their servers, but it does not affect us, for now.

     

    Anyway, as a work-around I deleted the condition in the IBM.Data.DB2.Core.targets file while maintaining x64 as the target cpu and it worked.

     

    The actual issue that is preventing us to use the new library is the fact that it is incompatible with all other drivers currently installed on the machine.

    On our development PCs we have the IBM Data Server Client, on our test server we have an instance of IBM DB2 Express-C, and on the customer server we have the DB2 Connect installed.

    All these installations are required in other older projects, so this means that until they are mutually exclusive there is no way fo start implementing the IBM.Data.DB2.Core package.

    At the moment we are relying on the full framework and the unofficial package of IBM.Data.DB2 10.0.0.5.

     

     

    Unfortunately for us, IBM does not provide a AnyCPU version of their DB2 EF components. They are either 32bit or 64bit.

    Ofcourse this causes lots of problems, as you then have to force all of your downstream components to be either 32bit or 64bit.

    IBM has not followed the advice of Microsoft and set it to AnyCPU to avoid these problems.

    There is no performance benefit of setting to either 32bit or 64bit, so nearly no one does it anymore these days, except for IBM.

    The reason I believe they are doing this is because their .NET driver is not truely a native .NET component. It uses COM/Interop interfaces to their existing C/C++ db2 drivers. Which of course if very unfortunate.

    If you want a true .NET component, DevArt and a few others provide a DB2 library that is more flexible. They have implemented all the raw level TCP/IP communication within the component itself and therefore does not require dependencies on huge bloatware like DB2 connects several hundred megabyte install.

  • PeterKam
    PeterKam
    6 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-05T18:10:58Z  

    Hi,

    I'm building a .NET Core application running on Bluemix. When I'm trying to connect to my dashDB using the EF core framework I'm getting the following error:

    An unhandled exception occurred while processing the request.

    ServiceException: An error occurred while writing to logger(s). (ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in Process: 34 Function: AESEncryptADONET (Encryption Info)
    Can anybody help? - Google didn't help much :-( 

     

  • PrashanthRaoK
    PrashanthRaoK
    66 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-06T07:44:49Z  
    • PeterKam
    • ‏2017-06-05T18:10:58Z

    Hi,

    I'm building a .NET Core application running on Bluemix. When I'm trying to connect to my dashDB using the EF core framework I'm getting the following error:

    An unhandled exception occurred while processing the request.

    ServiceException: An error occurred while writing to logger(s). (ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in Process: 34 Function: AESEncryptADONET (Encryption Info)
    Can anybody help? - Google didn't help much :-( 

     

    Hi ,

     

    Can you please give more details about your application development environment ?

     

    Are you developing locally on windows and then pushing the app to Bluemix Environment ?

     

    How are you setting the LD_LIBRARY_PATH variable ? are you using manifest.yml file or directly setting the variable in Bluemix Environment variable settings ?

     

    The error is because of either the gskit is not found or it found a old gskit version installed globally which is not supported with the version of the driver.

     

    To solve the error, please append the LD_LIBRARY_PATH variable with $HOME/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib/icc

     

    Please refer the "Getting Started on Bluemix ADO .Net Core Application to access IBM Data Servers(DB2 for z/OS, dashDB)" blog for DB2 ADO .NET Core application development on Bluemix

     

    Thanks,

    Prashanth.

     

     


     

  • PeterKam
    PeterKam
    6 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-06T08:04:15Z  

    Hi ,

     

    Can you please give more details about your application development environment ?

     

    Are you developing locally on windows and then pushing the app to Bluemix Environment ?

     

    How are you setting the LD_LIBRARY_PATH variable ? are you using manifest.yml file or directly setting the variable in Bluemix Environment variable settings ?

     

    The error is because of either the gskit is not found or it found a old gskit version installed globally which is not supported with the version of the driver.

     

    To solve the error, please append the LD_LIBRARY_PATH variable with $HOME/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib/icc

     

    Please refer the "Getting Started on Bluemix ADO .Net Core Application to access IBM Data Servers(DB2 for z/OS, dashDB)" blog for DB2 ADO .NET Core application development on Bluemix

     

    Thanks,

    Prashanth.

     

     


     

    Hi,

    ​Thanks for your reply.

    ​Currently I'm doing as described here:​https://console.ng.bluemix.net/docs/runtimes/dotnet/usingCustomLib.html#use_customlib

    ​So I've added a folder ld_library_path in the root of the application and copied the content of [user home]/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib into it. Im doing the development locally and have a DevOps toolchain configured so it gets pushed to Bliemix on every commit.

    ​I did not have any luck adding the LD_LIBRARY_PATH using the manifest file. I get a CF buildpack error when i try do as described in https://www.ibm.com/blogs/bluemix/2017/02/getting-started-on-bluemix-ado-net-core-application-to-access-ibm-data-serversdb2-for-zos-dashdb/

  • PrashanthRaoK
    PrashanthRaoK
    66 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-06T08:28:47Z  
    • PeterKam
    • ‏2017-06-06T08:04:15Z

    Hi,

    ​Thanks for your reply.

    ​Currently I'm doing as described here:​https://console.ng.bluemix.net/docs/runtimes/dotnet/usingCustomLib.html#use_customlib

    ​So I've added a folder ld_library_path in the root of the application and copied the content of [user home]/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib into it. Im doing the development locally and have a DevOps toolchain configured so it gets pushed to Bliemix on every commit.

    ​I did not have any luck adding the LD_LIBRARY_PATH using the manifest file. I get a CF buildpack error when i try do as described in https://www.ibm.com/blogs/bluemix/2017/02/getting-started-on-bluemix-ado-net-core-application-to-access-ibm-data-serversdb2-for-zos-dashdb/

    Hi ,

     

    Can you please share the error which you are seeing with setting LD_LIBRARY_PATH in manifest.yml file ?

     

    Is it possible to share the manifest.yml file ?

     

    What is the build pack you are using to push the application ?

     

    The recommended way for DB2 .Net Core is to set LD_LIBRARY_PATH using manifest.yml file.

     

    Have you tried configuring the environment variable by logging into the Application hosted on bluemix and change it over there and restart the application ?

     

    Thanks,

    Prashanth.

     

     

  • PeterKam
    PeterKam
    6 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-06T09:36:36Z  

    Hi ,

     

    Can you please share the error which you are seeing with setting LD_LIBRARY_PATH in manifest.yml file ?

     

    Is it possible to share the manifest.yml file ?

     

    What is the build pack you are using to push the application ?

     

    The recommended way for DB2 .Net Core is to set LD_LIBRARY_PATH using manifest.yml file.

     

    Have you tried configuring the environment variable by logging into the Application hosted on bluemix and change it over there and restart the application ?

     

    Thanks,

    Prashanth.

     

     

    Hi again,

     

    I'm not quite sure what build-pack / version I'm using, but I believe it should be OK as I'm using the one on Bluemix in UK (eu-gb.mybluemix.net)

     

    My manifest file looks like this:

    applications:
    - path: .
    memory: 512M
    instances: 1
    domain: eu-gb.mybluemix.net
    name: Stable-IOT
    host: stable-iot
    disk_quota: 2048M
    env:
    LD_LIBRARY_PATH: $HOME/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib

     

    I get this when pushing to Bluemix:

    Preparing to start the job...
    Downloading build artifacts...
    Failed to download artifacts from Object Storage with a status code 200. Retrying..
    Target: https://api.eu-gb.bluemix.net
    FAILED
    Error reading manifest file:
    env should not be null

     

    Then I figured it might solve the error putting env: and the parameter on the same line like this:

     

    applications:
    - path: .
    memory: 512M
    instances: 1
    domain: eu-gb.mybluemix.net
    name: Stable-IOT
    host: stable-iot
    disk_quota: 2048M
    env:
    LD_LIBRARY_PATH: $HOME/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib

     

    But then I get this:

     

    Preparing to start the job...
    Downloading build artifacts...
    Target: https://api.eu-gb.bluemix.net
    FAILED
    Error reading manifest file:
    yaml: line 8: mapping values are not allowed in this context

    Finished: FAILED

  • PrashanthRaoK
    PrashanthRaoK
    66 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-06T09:54:21Z  
    • PeterKam
    • ‏2017-06-06T09:36:36Z

    Hi again,

     

    I'm not quite sure what build-pack / version I'm using, but I believe it should be OK as I'm using the one on Bluemix in UK (eu-gb.mybluemix.net)

     

    My manifest file looks like this:

    applications:
    - path: .
    memory: 512M
    instances: 1
    domain: eu-gb.mybluemix.net
    name: Stable-IOT
    host: stable-iot
    disk_quota: 2048M
    env:
    LD_LIBRARY_PATH: $HOME/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib

     

    I get this when pushing to Bluemix:

    Preparing to start the job...
    Downloading build artifacts...
    Failed to download artifacts from Object Storage with a status code 200. Retrying..
    Target: https://api.eu-gb.bluemix.net
    FAILED
    Error reading manifest file:
    env should not be null

     

    Then I figured it might solve the error putting env: and the parameter on the same line like this:

     

    applications:
    - path: .
    memory: 512M
    instances: 1
    domain: eu-gb.mybluemix.net
    name: Stable-IOT
    host: stable-iot
    disk_quota: 2048M
    env:
    LD_LIBRARY_PATH: $HOME/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib

     

    But then I get this:

     

    Preparing to start the job...
    Downloading build artifacts...
    Target: https://api.eu-gb.bluemix.net
    FAILED
    Error reading manifest file:
    yaml: line 8: mapping values are not allowed in this context

    Finished: FAILED

    Seems like the problem is with your manifest.yml file.

    It is sensitive to space and you need to give one or more space in the next line after env: and then mention the LD_LIBRARY_PATH value .

    Sample :
    applications:
    - path: .
    memory: 512M
    instances: 1
    domain: eu-gb.mybluemix.net
    name: Stable-IOT
    host: stable-iot
    disk_quota: 2048M
    env:
        LD_LIBRARY_PATH: $HOME/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib

     

     

  • PeterKam
    PeterKam
    6 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-06T10:36:36Z  

    Seems like the problem is with your manifest.yml file.

    It is sensitive to space and you need to give one or more space in the next line after env: and then mention the LD_LIBRARY_PATH value .

    Sample :
    applications:
    - path: .
    memory: 512M
    instances: 1
    domain: eu-gb.mybluemix.net
    name: Stable-IOT
    host: stable-iot
    disk_quota: 2048M
    env:
        LD_LIBRARY_PATH: $HOME/.nuget/packages/IBM.Data.DB2.Core-lnx/1.0.0.100/build/clidriver/lib

     

     

    Hi again,

     

    Thanks!

     

    That solved the mainfest problem! - now the application is being pushed to Bluemix with no errors. BUT now I get this

    An unhandled exception occurred while processing the request.

    ServiceException: An error occurred while writing to logger(s). (Unable to load DLL 'libdb2.so': The specified module could not be found.
    (Exception from HRESULT: 0x8007007E))

    That is why I initially added the ld_library_path to the root of my application.

  • PrashanthRaoK
    PrashanthRaoK
    66 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-06T10:59:59Z  
    • PeterKam
    • ‏2017-06-06T10:36:36Z

    Hi again,

     

    Thanks!

     

    That solved the mainfest problem! - now the application is being pushed to Bluemix with no errors. BUT now I get this

    An unhandled exception occurred while processing the request.

    ServiceException: An error occurred while writing to logger(s). (Unable to load DLL 'libdb2.so': The specified module could not be found.
    (Exception from HRESULT: 0x8007007E))

    That is why I initially added the ld_library_path to the root of my application.

     

    Can you please login into to your bluemix env and check the path in which packages are installed and set that path to LD_LIBRARY_PATH ?

     

    Also can you use this command while pushing the app : bluemix cf push <app_name> -b dotnet-core

  • PeterKam
    PeterKam
    6 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-06T11:58:39Z  

     

    Can you please login into to your bluemix env and check the path in which packages are installed and set that path to LD_LIBRARY_PATH ?

     

    Also can you use this command while pushing the app : bluemix cf push <app_name> -b dotnet-core

    Hi,

     

    Attached is the Bluemix CF build log. As you can see all nuget packages are only stored temporarily and are removed after a successfully deploy. I do not think that the DB2 client libraries are available at all unless you add the files to the application (for instance in ld_library_path) as described here:  https://console.ng.bluemix.net/docs/runtimes/dotnet/usingCustomLib.html#use_customlib

    Could it be incompatibility issues with the lib files in the nuget package vs the Ubutu release that the Bluemix .net core buildpack is running on?

    Attachments

  • PrashanthRaoK
    PrashanthRaoK
    66 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-08T11:07:32Z  
    • PeterKam
    • ‏2017-06-06T11:58:39Z

    Hi,

     

    Attached is the Bluemix CF build log. As you can see all nuget packages are only stored temporarily and are removed after a successfully deploy. I do not think that the DB2 client libraries are available at all unless you add the files to the application (for instance in ld_library_path) as described here:  https://console.ng.bluemix.net/docs/runtimes/dotnet/usingCustomLib.html#use_customlib

    Could it be incompatibility issues with the lib files in the nuget package vs the Ubutu release that the Bluemix .net core buildpack is running on?

    Hi ,

     

    You can try any of the following :

     

    1)

             a) In your local machine, Copy the entire 'clidriver' folder from <local_package_installed_location>/IBM.Data.DB2.Core-lnx/1.0.0.100/build/  to your project folder side by side to your csproj.

     

             b) Open the manifest.yml file and update the LD_LIBRARY_PATH variable with the location of your project files in bluemix environment.

                 For ex :  LD_LIBRARY_PATH: /tmp/app/IBM.IOT.Stable.Services/clidriver/lib

     

             c) deploy the entire clidriver folder along with your other project folder and files to bluemix  and see if it works.

     

                                                                                     OR

     

    2) Force the MSBuild to copy the clidriver into the publish output folder and set the LD_LIBRARY_PATH accordingly.  The application is published to the folder "/home/vcap/app/.cloudfoundry/dotnet_publish/", so the LD_LIBRARY_PATH would then be something like "/home/vcap/app/.cloudfoundry/dotnet_publish/clidriver/lib" after the MSBuild copy the clidriver folder from project root to the publish output folder.

     

    Thanks,

    Prashanth.

     

     

    Updated on 2017-06-08T11:08:38Z at 2017-06-08T11:08:38Z by PrashanthRaoK
  • PeterKam
    PeterKam
    6 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-06-08T11:44:23Z  

    Hi ,

     

    You can try any of the following :

     

    1)

             a) In your local machine, Copy the entire 'clidriver' folder from <local_package_installed_location>/IBM.Data.DB2.Core-lnx/1.0.0.100/build/  to your project folder side by side to your csproj.

     

             b) Open the manifest.yml file and update the LD_LIBRARY_PATH variable with the location of your project files in bluemix environment.

                 For ex :  LD_LIBRARY_PATH: /tmp/app/IBM.IOT.Stable.Services/clidriver/lib

     

             c) deploy the entire clidriver folder along with your other project folder and files to bluemix  and see if it works.

     

                                                                                     OR

     

    2) Force the MSBuild to copy the clidriver into the publish output folder and set the LD_LIBRARY_PATH accordingly.  The application is published to the folder "/home/vcap/app/.cloudfoundry/dotnet_publish/", so the LD_LIBRARY_PATH would then be something like "/home/vcap/app/.cloudfoundry/dotnet_publish/clidriver/lib" after the MSBuild copy the clidriver folder from project root to the publish output folder.

     

    Thanks,

    Prashanth.

     

     

    Hi,

    Sorry for not getting back to you in time.

    I already solved the problem like this:

    • Copy the entire clidriver folder from the .nuget folder to the root of the application (same location as the manifest and sln file)
    • Modify the manifest file and let LD_LIBRARY_PATH point to /home/vcap/app/clidriver/lib

    That's it - now i get the connection to DB2 (dashDB) without any errors.

     

    Thanks for all your help!

  • onkarw210
    onkarw210
    14 Posts

    Re: Discussions: IBM Data Server Provider (Beta) support for .NET Core

    ‏2017-07-27T13:32:15Z  

    Getting Index (zero based) must be greater than or equal to zero and less than the size of the argument list. error in .net core 1.0.0

    I am trying to do Database connectivity with IBM DB2 in MVC core 1.0 using Entity framework 
    But getting Index (zero based) must be greater than or equal to zero and less than the size of the argument list exception while trying to open connection 

    startup.cs file code

    services.AddDbContext<SampleContext>(options => options.UseDb2(Configuration.GetConnectionString("ConnectionStringName"),
                    p => p.SetServerInfo(IBMDBServerType.LUW, IBMDBServerVersion.LUW_11_01_1010)));

    Connection String

    "DATABASE=<DBName>SERVER=<server name>:<Port no>;UID=<user name>;PWD=<Pass>;"

    DB Connection code:
    var db = _SampleContext.Database.GetDbConnection();
    if (db.State != ConnectionState.Open)
                            db.Open();

     

    Modified PATH environment location :

    C:\Users\UserName\.nuget\packages\IBM.Data.DB2.Core\1.1.1.101\build\clidriver\bin

    Used Nuget packages

    "IBM.EntityFrameworkCore": "1.1.1.101",
    "Microsoft.EntityFrameworkCore": "1.1.2",
    "Microsoft.EntityFrameworkCore.Relational": "1.1.2",
    "NETStandard.Library": "1.6.1",
    "System.Data.Common": "4.3.0"