Visual Studio Set-Up Using the iNetwork Toolkit

back to iNetwork

Introduction

This tutorial shows how to get started creating basic client and server iNetwork programs. To do this, it shows you how to start Visual Studio solutions that include the iNetwork client and server templates, and references to the iNetwork library. Once you do this, you can then modify the client and server to do something useful (see the tutorials for examples).

Note: At the end of this exercise, you can compile the client and server. However, it won't actually do anything useful.

back to top

Getting Started

  1. You should already have both the client and server templates installed.
  2. Open Visual Studio 2010.
  3. Choose one of two ways to set-up the solution:

Note: We recommend the one solution set-up for routine development because it keeps the client and server projects within the same solution. The two solution set-up would be better if clients are developed independent of the server.

One Solution Set-Up

We show you how to create both the client and server in the same project.

  1. Open Visual Studio and create a new project.
  2. Create the Solution and Client program as follows.
    1. On the left hand side of the New Project window (see below) is a list of Templates. Choose Installed Templates then within that choose Visual C#.
    2. The middle panel displays a list of templates. Select iNetwork Client Template.

    3. Change the Name of the application to something meaningful (e.g., iNetworkClient), as well as the Solution name (e.g., iNetwork Solution) then click OK.
    4. In the solution explorer, you should now see the solution and your client program as something like:

  3. Create the Server program as follows, where you will add it to the solution.
    1. In the Solution Explorer, right click on the Solution name (e.g., in this example, iNetwork Solution).
    2. Select Add.
    3. Select New Project.
    4. Similar to what you did above, select the iNetwork Server Template.

    5. Change the Name of the server application to something meaningful (e.g., iNetworkServer), and then OK.
    6. The Solution Explorer should now look something like the following:

  4. Add a reference for both the client and server to the iNetwork toolkit.
    1. Under the client project, right click on References.
    2. Select Add Reference...
    3. In the Add Reference window select the Browse tab.
    4. Go to the Projects folder in Visual Studio 2010.
    5. Open the folder called iNetwork Toolkit.
    6. Select GroupLab.iNetwork.dll then click OK.
    7. Repeat these same steps for the server project.

Running the program will be very simple. In this case make sure that the Server is set as the start-up project. To do this, right click on the Server in the Solution Explorer and select Set as Start-Up Project. This guarantees that the server runs before the client. It is important that the server is running before the client instances are run. In order to run/add more instances of the client, right click on the Client in the Solution Explorer, select Debug and select Start new instance.

back to top

Set-Up with Two Solutions

In this version of the set-up you are to create two completely separate projects; one for the client and the other for the server.

This can be created using an identical process as given above in the first two steps. Instead of adding the server project to the existing solution, just create it in a new solution by using exactly the same process used to create the client project.

Don't forget to add the reference to the iNetwork Toolkit!

Running the program will be very simple. In this case all you must do is run the server project first then run the client project. It is important that the server is running before the client instances are run. In order to add more instances of the client, right click on the Client in the Solution Explorer, select Debug and select Start new instance.

back to top