C# .NET application compile and link options
This topic describes the various options available when compiling and linking C# .NET applications.
The compile and link options available to Db2® for building C#
applications on Windows with the Microsoft C# compiler, as demonstrated in the bldapp.bat
batch file.
Note: The .NET Framework Version 1.1 is supported only with
the .NET Provider Version 9.5 and earlier.
Compile and link options for stand-alone C# applications using bldapp:
Compile and link options for stand-alone
C# applications:
- Variable for the compiler. The default is
csc
, the Microsoft C# compiler. - Reference the Db2 dynamic link library for
the .NET framework version you are using.
- There are several supported versions of the .NET framework for applications. Db2 has a dynamic link library
for each version. For .NET
Framework Version 2.0, 3.0, and 3.5,
%VERSION%
points to thenetf20\
sub-directory.
%VERSION%
- There are several supported versions of the .NET framework for applications. Db2 has a dynamic link library
for each version. For .NET
Framework Version 2.0, 3.0, and 3.5,
%BLDCOMP%
/r:"%DB2PATH%"\bin\%VERSION%IBM.Data.DB2.dll
Compile and link options for the loosely-coupled sample
program, LCTrans
using bldapp:
- Variable for the compiler. The default is
csc
, the Microsoft C# compiler. - Output the
RootCOM
dynamic link library, used by theLCTrans
application, from theRootCOM.cs
source file, - Output the
SubCOM
dynamic link library, used by theLCTrans
application, from theSubCOM.cs
source file, - Create the dynamic link library from the input source file (
RootCOM.cs
orSubCOM.cs
). - Reference the Microsoft Windows System EnterpriseServices data link library.
- Reference the Db2 dynamic link library for
the .NET framework version you are using.
- There are several supported versions of the .NET framework for applications. Db2 has a dynamic link library
for each. For .NET Framework Version 2.0, 3.0, and
3.5,
%VERSION%
points to thenetf20\
sub-directory.
%VERSION%
- There are several supported versions of the .NET framework for applications. Db2 has a dynamic link library
for each. For .NET Framework Version 2.0, 3.0, and
3.5,
- Reference the Microsoft Windows System Data dynamic link library.
- Reference the Microsoft Windows System dynamic link library.
- Reference the Microsoft Windows System XML dynamic
link library (for
SubCOM.cs
). - Reference the SubCOM dynamic link library (for
RootCOM.cs
andLCTrans.cs
). - Reference the RootCOM dynamic link library (for
LCTrans.cs
).
%BLDCOMP%
/out:RootCOM.dll
/out:SubCOM.dll
/target:library %1.cs
/r:System.EnterpriseServices.dll
/r:"%DB2PATH%"\bin\%VERSION%IBM.Data.DB2.dll
/r:System.Data.dll
/r:System.dll
/r:System.Xml.dll
/r:SubCOM.dll
/r:RootCOM.dll
Refer to your compiler documentation for additional compiler options.