IBM Support

IBM i .NET Data Provider And .NET Core

Product Documentation


Abstract

The IBM i .NET data provider (IBM.Data.DB2.iSeries) is not supported for use with .NET Core

Content

Microsoft states: ".NET Framework 4.8 is the last version of .NET Framework." In 2016, Microsoft created a new version of .NET called .NET Core (now called just .NET) that is a platform-independent implementation successor to the .NET Framework. Because it is platform-independent, many Windows-specific APIs that were provided by .NET Framework are not available in .NET Core. Because the IBM i .NET data provider depends on some of those Windows-specific APIs, it does not work in .NET Core, and an attempt to use this .NET provider results in a failure. The exception received doesn't make clear what the cause of that failure is. The following is the failure I get from a simple .NET Core application that loads and makes a connection with the IBM i .NET data provider:
System.TypeInitializationException: The type initializer for 'IBM.Data.DB2.iSeries.iDB2Trace' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
   at IBM.Data.DB2.iSeries.iDB2Trace..cctor()
   --- End of inner exception stack trace ---
   at IBM.Data.DB2.iSeries.iDB2Connection..ctor(String connectionString)
   at ConsoleApp1.Program.Main(String[] args) in c:\users\ibm_admin\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:line 12
Alternatives:
  • Microsoft provides an ODBC bridge provider System.Data.Odbc, available in NuGet, which can be used with the IBM i Access ODBC driver
  • The .NET provider from the Db2 Connect family can be used with .NET Core. Contact your business partner or IBM sales representative for details on these products
  • While not a standard .NET data provider, the open source IbmiXmlserviceStd package provides database access (along with the ability to call programs, CL commands, and more) in .NET through XMLSERVICE

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSRQKY","label":"IBM i Access Client Solutions"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
05 December 2022

UID

ibm10795666