Installation of the Information Server

1. Copy the Information Server into the project directory

Go to the distribution directory and copy the directory into the Information Server directory (in our example to: "c:\\services\ Information Server") and rename the directory "contoso" or according to your project. Under "c:\\services\ Information Server\contoso", you should now find the files of the Information Server.

2. Installation of the service

.NET-based Windows services are installed via the command line program installutil.exe. To do this, simply open a command line and change into the copied directory. Should you not be logged in as Administrator and if UAC (User Account Control) is activated, you need to start the command line as administrator.

The required program installutil.exe is already stored in your computer in the directory „%WINDIR%\\framework\v2.0.50727\“.

For the installation, execute this program with the following arguments:

%WINDIR%\Microsoft.NET\Framework\v2.0.50727\installutil.exe /servicename=ONION_contoso Onion.Server.WindowsService.exe

The argument /servicename controls the name of the service allocated later. For every entity of an Information Server, a unique name must be allocated. As can be seen in the command, the prefix ONION_ should be added before the project name.

When the command has been executed, the service can be seen in the Windows service console.

If desired, you can now switch the start type from "manual" to "automatic". If available (which is, for example, not the case with Windows XP), you should set the start type to "Automatic (Delayed Start)". If the SQL server runs on the same server, it could happen that the Information does not start. The reason for this is that the Information Server tries to connect to the SQL server that is not yet ready for operation. In case of a delayed start, one minute passes until the Information Server is started. By that time, the SQL server will be ready. 

Before you start the service, read the Chapter Rights management below.

The uninstalling of the service is effected with the same command and the additional argument /u.

3. Configuration of the Information Server

In the target directory of the Information Server, you will find a configuration file called "Onion.Server.WindowsService.exe.config".

3.1. SQL-Server connection

In the configuration file, you will find the attribute connectionString (highlighted in the Figure) under configuration/onion/server. In this string, you can set up the information for connecting to the database. Configure the database to ONION_contoso and the connection information to the SQL-Server, if and as required.

More information on user rights can be fount in the Chapter Rights management below.

If the SQL server runs on the same server as the Information Server, "Shared Memory" should be used as protocol. In case of SQL Server Express, this is the only protocol that is active. On the one hand, this protocol is faster because it does not use the network interface and on the other hand, it is safer because the SQL server can thus not be accessed via external sources. 

With this protocol, it is necessary to configure another parameter "Network Library" with the value "dbmslpcn" in the connectionString. Otherwise, the system will try to make a connection via named pipes or TCP/IP.

if the SQL Server runs on a different server, you should use TCP/IP. To do this, the protocol must be activated on the SQL Server.

3.2. Caching

The configuration pre-set under configuration/onion/server/cacheSettings has a pre-set Content Caching of approx. 150 MB to relieve the database server. These settings are sufficient for the time being.

3.3. Connection of user repositories

If you wish to connect an LDAP or Active Directory to, you can configure this under configuration/onion/userRepositories. A description of the application can be found in the comments of the configuration file.

If you do not want this connection, you can keep this section as it is. As a default (configuration/onion/userRepositories/internalDirectory), the login of an user is disabled for one minute following three faulty log-ins.

3.4. Availbility of services via .NET Remoting

In this chapter, we show you how to configure the connection of the service. The most important setting in case of several entities is the port connection. Port 8087 is configured as standard port. The configured port must not be used by other applications. 

3.5. Incident log file

To create a log of incidents, log4net is used. The configuration options of log4net can be found in the Chapter log4net.

With the standard settings, a log file is created in the current directory under "logs\debug.log". Since the installation example contains a log directory under "c:\", this directory can also be configured, for example: "c:\\logs\contoso\informationserver.log". 

4. Rights management

Two aspects need to be taken into consideration during the allocation of rights. Windows services are started with a user account. Usually, this is the account "Local system".

If you now wish to start the service with your own account, the following needs to be fulfilled.

4.1 Writing of log files

Usually, log4net on the Information Server is configured in such a way that it creates log files. In order to create, write and delete these files, the service must have the respective rights in the log directory. 

4.2. Connection to the SQL server

A connection to the SQL server can be created via the user configured in the configuration file or, in the integrated mode, with the user account on the basis of which the service is running. If you do not want to save access data in the configuration file, you can configure the integrated mode. In this case, however, the user account of this service must receive access rights to the database.

The user from which access to the database is to be made, must be the owner of the database so that tables and stored procedures can be created, updated or deleted during the start. 

5. Start the Information Server

You can now start the service. The first start will take a little longer because the service needs to create the required tables, schemes, users and sets of data in the database.

If an error message appears during the start, the error will be precisely described in the log file.