Using the C# samples

The C# sample files are installed in various subdirectories in the location installation_location/sdk/csharp. There is one subdirectory for each sample. All executable files are located in installation_location/sdk/csharp/bin.

The folder installation_location/sdk/csharp/SamplesCommon contains a solution that provides several classes used by other samples.

Each of the subdirectories contain the following files:

  • AssemblyInfo.cs
  • sample_name.cs
  • sample_name.csproj
  • sample_name.sln
  • build.bat
  • csharp_sample_name_Explain.html

Some samples may have additional files.

You must reference the cognosdotnet_10_2.dll and cognosdotnetassembly_10_2.dll files in your Visual Studio project. There are two versions of these files:
  • .NET Framework 4.0 versions located in installation_location/sdk
  • .NET Framework 3.5 versions located in installation_location/sdk/NET3.5
Note:
  • The solution (.sln) and project (.csproj) files require Visual Studio, version 2010 or later.
  • AllSamples.sln in installation_location/sdk/csharp includes all the sample projects. We recommend that you use this solution when you want to build all the C# samples at the same time.

In each sample, the build.bat script included with the sample code shows one way of building the application using the Visual Studio compiler. For more information about using build.bat, see the comments in the file.

Read the csharp_sample_name_Explain.html file before you run any of the C# samples. These files provide instructions about running the sample programs, and contain information about associated files. They are located in installation_location/sdk/csharp/sample_name.

In addition, the source files contain comments to help you follow the sequence, and understand what each sample does. We recommend that you become familiar with .NET programming techniques before you modify any of the samples.

The C# samples include executable programs, located in installation_location/sdk/csharp/bin. If you receive an automation error when you launch an .exe program, you must recompile the program for your environment.