Data Management Global

 View Only

Downloading and initial configuration of Db2 .NET NuGet Packages

By Hosathota Vishwanatha posted Sun July 12, 2020 11:33 PM


The article lists the basic information needed to use the Db2 .NET Driver packages. The write up captures the important information on choosing the Db2 .NET drivers, downloading and configuring them for first use. The document will not go into any specific application scenarios as they are covered in detail in other blogs.

Recommended latest IBM Db2 .NET drivers
For .NET 6 and .NET 7 based applications
Db2 .NET driver for Microsoft .NET 6 and .NET 7 (The package name is Net.IBM.Data.Db2
IBM EntityFrameworkCore for ,NET 6 and .NET 7

For .NET5 based applications
Db2 .NET driver for Microsoft .NET 5(The package name is Net5.IBM.Data.Db2)
IBM EntityFrameworkCore for .NET 5

For .NET Framework based applications
EntityFramework 6.4 (For .NET Framework)

For .NET Core based applications(Out of support)
Db2 .NET Core
IBM EntityFrameworkCore

Supported platforms and download link for Db2 .NET 6 and .NET 7 packages

Supported Operating Systems:

  1. Windows x64
  2. Linux AMD64(known exception Alpine Linux)
  3. MacOS

All packages are available for download from NuGet repository.

License requirements


IBM license version

To be placed at












  • Starting with .NET Core, the license files are to be placed inside the buildTransitive folder instead of the build folder earlier. For example:

          On Windows:


          On Linux:


           On MacOS:


  • For Db2 .NET 5, the value packages\\ should be replaced by packages\\ since there is a change in package name.
  • For Db2 .NET 6 and above, the value packages\\ should be replaced by packages\\
  • On Azure Environment, the environment variable DB2_COMMON_APP_DATA_PATH should be set to be a writable location. This is one of the common issues noticed in recent times for license error -1598. After setting the above environment variable, its important to make sure the path has write permission.

Related Db2 .NET package blogs

For .NET Core packages, follow the below link to get started and explore more scenarios with Db2 .NET Core packages.

Getting Started with IBM Data Provider for .NET 6 and .NET 7

Breaking changes in Db2 .NET 6

  • There is a change in the package name for .NET runtime and is changed to Net.IBM.Data.Db2. This name will remain same for future versions also.
  • In some docker related scenarios, the path of clidriver\bin may need to be added to path variable.

Breaking changes in Db2 .NET 5

  • There is a change in the package name for .NET runtime and is changed to Net5.IBM.Data.Db2.
  • The assembly namespace has changed to IBM.Data.Db2. It was IBM.Data.DB2.Core for Db2 .NET Core packages.
  • Version -- Support for Row Change Timestamp columns with IBM EF Core provider.

Known limitations

Please refer to known limitations page for set of known limitations.

Last updated On 19th April 2023





Fri January 20, 2023 12:08 PM


I have an Azure Function that is throwing the following exception: 

IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in Process: 4992 Thread 59 AppDomain: Name:Microsoft.Azure.WebJobs.Script.WebHost There are no context policies. Function: AESEncryptADONET (Encryption Info) CallStack: at System.Environment.get_StackTrace() at IBM.Data.DB2.Core.DB2ConnPool.HandleUnknownErrors(String strFncMsg, Exception exception, Boolean bThrow) at IBM.Data.DB2.Core.DB2ConnPool.EncryptString(String value) at IBM.Data.DB2.Core.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach, Boolean pushDownStrAppended) at IBM.Data.DB2.Core.DB2Connection.set_ConnectionString(String value) at IBM.Data.DB2.Core.DB2Connection..ctor(String connectionString) at stuff_logs_logic.StuffLogsRepository.OpenConection() 

I appreciate any feedback!

Tue October 19, 2021 04:28 AM

 you can use the regular connection string below by replacing values inside <>

No license is needed for connecting to Informix server.


Thu October 07, 2021 04:36 PM


I find myself wanting to develop solutions using .Net Core 3.1 and Entity FrameWork. I would need it to happen to me in the first instance, how should I build my connection string to connect to an Informix database? How can we access a trial license to be able to use the entity framework? And where are the costs of acquiring the license for connection to informix via entity Framework?


Wed September 02, 2020 02:32 AM

Hi Vishwa!

Thanks for the answer, yes IBM support contacted and I found a useful link about the same problem,


Sun August 30, 2020 10:11 PM

Hi Denny,
 can you please contact IBM support for this? Have you used a trial license. If not, please request for the same.


Mon August 24, 2020 03:12 AM

I am having big problems connecting to DB2 database.
Visual Studio 2019, .NET Core 3.1 and IBM.Data.DB2.Core(

Version of IBM DB2
07.01.0000 OS/400 V7R1M0

Unhandled exception. IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [42968]

[IBM] SQL1598N  An attempt to connect to the database server failed because of a

 licensing problem.  SQLSTATE=42968

So i checked,

Ran db2level command,


DB21085I  This instance or install (instance name, where applicable: "*") uses

"64" bits and DB2 code release "SQL11054" with level identifier "0605010F".

Informational tokens are "DB2 v11.5.4000.1449", "s2006161200",

"DYN2006161200WIN64", and Fix Pack "0".

Product is installed at "d:\progapp\tccm\NETCORE\DB2\clidriver" with DB2 Copy

Name "IBM Data Server Driver For ODBC and CLI".

Running db2diag command:

2020-08-26- E10403F846           LEVEL: Error

PID     : 17028                TID : 14060          PROC : ImportTrygg.exe

INSTANCE:                      NODE : 000           DB   : DKDDTUDV



EDUID   : 14060

FUNCTION: DB2 UDB, Connection Manager, sqleuPerformServerActivationCheck, probe:


MESSAGE : ADM12008C  The product "IBM Data Server Driver For ODBC and CLI" does


          not have a valid license key installed and the evaluation period has

          expired. Functions specific to this product are not enabled. If you

          have licensed this product, ensure the license key is properly

          installed. You can install the license using the db2licm command. The


          license file can be obtained from your licensed product CD.


db2diag invoked with the default set of filtering/formatting options

on file "D:\progapp\tccm\NETCORE\DB2\clidriver\bin\db2diag.log".

Enter "db2diag -h" to get a short description of all available options.

My customers version of DB2 is V7R1M000 and iSeries(former AS/400?). What shall I do in order to get things right?
Is it even possible/doable with current versions?

Where do I find the license file needed? If any needed....
I am building my project locally and then want to deploy it on our customers server....

Best Regards
Denny Pedersen

Fri August 14, 2020 03:38 AM

Hi Nuno,
  we have a dependency on unmanaged dlls to achieve the lower level database interactions and they are different for different platforms. We tried to combine them into single package but then the size of the package becomes three times the current size and idea was dropped. At this point, we only have three separate drivers for three platforms.

Please feel free to open an Aha request( )  and we can prioritize in future if there are enough requests for the same.


Wed August 12, 2020 04:29 PM


Hope that you are doing well.

I was wondering, what is the difference between the nuget of netcore 3.1? Why there are 3 nugets, one for each environment?

It turns more, way more, complex the development process and the build pipelines for the projects. I can't have the team developing the projects (regardless the Operating System) with different nuggets differ from OS to OS. The same apply to CI/CD pipelines which may build on Windows agents or Linux agents. Further more on deploy, I may deploy it on containers, Cloud, Windows or even on *nix environments.

Did I miss something? 

I appreciate the feedback.

Best Regards
Nuno Cancelo