Installation of NET integration


There are two major projects in the LINUX environment that try to implement .NET integration. This is the DotGNU project hosted on www.dotgnu.org and the Mono project hosted on www.go-mono.com. Currently .NET integration could only be used with the DotGNU Portable.NET software distributed by the DotGNU project. The reason is that the C-sourcecode of this project makes it much simpler to integrate the software with HBasic than the self-hosting compiler of the Mono project.

Integrate .NET support for HBasic therefore requires two steps of preparation and two steps to integrate into your project.

1) Download and install the DotGNU Portable.NET compiler and libraries
2) Compile and install the HBasic .NET integration library

After you have finished this installation steps you can insert the .NET integration into your project in the project options dialog and insert NET libraries into your project.

3) Insert .NET support into your current HBasic project.
4) Include NET libraries for your current project


1) Download and install DotGNU Portable.NET

Download C# Compiler and PNET library files from www.dotgnu.org. This normally requires
Compile and install this files on your computer in whatever directory you like. This normally requires to
Have a look at the installation instructions of this packages or at the page of southern-storm if you get problems with this short description.


2) Compile and install the HBasic .NET integration library

HBasic uses a special dynamic library to integrate the NET functions into the HBasic program. This library will be compiled and installed if you run  make net in the HBasic source directory. You can find the sourcecode and Makefile for the net integration in the net_support subdirectory of your HBasic distribution.

Before you can compile this library correctly you have to insert the path of the directory where you have unpacked and compiled the pnet-* files into the Makefile in the net_support directory. In the first lines of this Makefile is an entry like

PNETDIR=/usr/src/pnet-<version-number>

Replace this with your installation path of the pnet-package.

PNETDIR=<your installation path of pnet files>

HBasic needs this to read the includefiles and libraries of the DotGNU software which will be used in the DotGNU integration library.

The generated library will be called net_support.hbso and will be placed in the /usr/local/hbasic/lib directory. If you want to integrate .NET support into the current HBasic project HBasic will start loading this library.

If you didn't compile the DotGNU library before you compiled HBasic this integration library will not be created and you therefore cannot load NET integration from HBasic. If you want to add .NET support later rerun make and make install for HBasic to create this library.


3) Insert .NET support into your current HBasic project.

After you have compiled and installed the libraries required for .NET integration you have to select in your current project if you want to use this functions or not. The .NET integration library will not be loaded on default because it requires some memory ressources and takes some time to load on every start.

To use .NET integration in your current project you have to activate it in the project options. This project options will be stored in the project file if you save your current project. If you reload this project description HBasic will automatically try to load this Dot-GNU integration library again.
 

4) Include .NET libraries for your current project

If you compile a C# program or try to use classes that will be distributed with the DotGNU project (like mscorlib.dll) this class descriptions and the generated code will be distributed in library files. You have to include this files into yout HBasic project like normal HBasic packages. To use for example the class System.Console from the file mscorlib.dll in yout project execute the following steps.
After loading the library file the classes of the library file will be displayed. You can get some more information about methods, properties... of the library in the package editor.

You can find a C# class definition that will be used with some .NET example programs in the code_examples directory of your HBasic distribution.