C# Prerequisites
This section gives information on what is required to get started using the C# API for Universal Messaging. The C# API for Universal Messaging is available in a DLL distribution for developing native Microsoft Windows applications ("Nirvana DotNet.dll").
Universal Messaging .NET
Universal Messaging .Net requires Microsoft .Net Framework, which you can download from the Microsoft Download website at
http://www.microsoft.com/downloads/. The .NET installer will automatically set up the environment such that C# applications can be compiled and run natively on Microsoft Windows. Please see the Environment Setup section below for information on how to compile and run applications using the Universal Messaging C#.NET API.
SSL
To subscribe to a channel using an SSL interface, extra requirements must be met. Universal Messaging C# supports client certificate authentication as well as anonymous SSL. For client certificate authentication, the location of the client certificate and private key password, as well as the trust store must be known to the application. For instructions on how to run Universal Messaging C# applications using an SSL enabled interface, please see Client SSL.
Environment Setup
Compilation
It is recommended that you use Microsoft Visual Studio to compile Universal Messaging C# applications. Visual Studio will set up the required environment for compiling C# applications. However to make use of the Universal Messaging APIs, the location of the Universal Messaging libraries will need to be referenced such that they can be found by the compiler.
The libraries can be found in the <InstallDir>\UniversalMessaging\dotnet\bin directory. For native Windows applications the "Nirvana DotNet.dll" library is required.
Runtime
The Universal Messaging DLLs used to compile C# applications are unlike C++ in that these libraries are used both at compile time and at runtime. At compile time, the location of the library is specified as a reference such that it can be used by the compiler. At runtime this library is looked for in the same directory as the executable. For information on how to run an application without the DLL in the same directory, see Globally Accessible DLLs.
Sample Applications
The <InstallDir>\UniversalMessaging\dotnet\bin directory contains precompiled sample applications for Universal Messaging C#.Net. These applications can be run on a PC running Microsoft Windows which has .NET installed as described above.
The source code for each application can be found in <InstallDir>\UniversalMessaging\dotnet\examples along with a batch file which can be used to compile the application:
> cd <InstallDir>\UniversalMessaging\dotnet\examples\channeliterator
> builddotnetsampleapp.bat channeliterator
This will compile the channeliterator sample application and place the executable in the dotnet\bin directory.