Build C# Samples using Visual Studio

Introduction

This tutorial shows how to build the C# Samples project with reference to Zivid C++ API using Visual Studio in Windows.

Requirements

Optional requirements

Some of the samples depend on external libraries, in particular:

Instructions

Step by step instructions is provided with screenshots below.

Clone C# samples

To clone our GitHub Zivid C# Samples repository, launch the Command Prompt by pressing Win + R keys on the keyboard, then type cmd and press Enter.

Windows Run command

Navigate to a location where you want to clone the repository (Git has to be installed):

cd C:\Users\Public\Downloads

Then run the following command:

git clone https://github.com/zivid/zivid-csharp-samples

Install extra dependencies

Install required dependencies based on the sample programs you want to run; see the table below.

Sample program

MathNet.Numerics

System.ValueTuple

UtilizeHandEyeCalibration

Yes

No

PoseConversions

Yes

No

ROIBoxViaCheckerboard

Yes

No

ROIBoxViaArucoMarker

Yes

No

AutomaticNetworkConfigurationForCameras

No

Yes

MathNet.Numerics and System.ValueTuple libraries can be installed using the NuGet package manager within Visual Studio. If you have allowed NuGet to download missing packages, these packages will be installed automatically.

Alternatively, you can use the command-line interface to install them by typing the following in the Package Manager Console:

  • MathNet.Numerics: Install-Package MathNet.Numerics

  • System.ValueTuple: Install-Package System.ValueTuple

Build the solution

Open ZividNETSamples.sln in Visual Studio.

Change the build configuration from Debug to Release.

Build the solution by pressing Ctrl + Shift + B.

C# samples Visual Studio solution

Run the sample program

Navigate to the Release folder in File Explorer.

C# samples Release folder path

Run a sample program, e.g. CaptureVis3D.exe

Output point cloud from CaptureVis3D