C# (.NET)
First, select your operating system:
There are two options for creating a C# project and adding the library in Windows:
Project Creation
Visual Studio
To add the library in Visual Studio:
- Create a new Console Project by selecting File > New > Project..., then select Console App or Console App (.NET Core).
- After the project is created, select Project > Manage NuGet Packages... in the menu bar.
- In the package manager, select the Browse tab.
- Search for
Zaber.Motion, then select it from the results and click Install. Click OK in the confirmation dialog. - When the package manager is finished installing the library, you can close the package manager.
Your project should now contain a reference to the
Zaber.Motionlibrary.
You may continue the Getting Started guide by running the example code.
DotNet command line
First, confirm that DotNet is installed by entering the following command into a terminal and confirming a version is returned:
dotnet --version
# Example output:
# 6.0.403
Create a new project and switch to that directory by entering the following commands into the terminal (replace example with your desired project name):
dotnet new console --name example
cd example
Then add the Zaber.Motion library to your project by entering the following in the terminal:
dotnet add package Zaber.Motion
Open the project in a code editor, then continue the Getting Started guide by running the example code.
Updating
To update to the latest version (9.1.0), use one of the following methods:
Visual Studio
- Select Project > Manage NuGet Packages....
- Select the Installed tab in the package manager.
- You should see
Zaber.Motionin the list including information about what version you currently have. Select it then select Update.
DotNet command line
The command to update the library using the DotNet command line is the same as the command to add the library. Enter the following command in the root directory of your project:
dotnet add package Zaber.Motion
To determine what version of the library you already have, enter the following command in the root directory of your project:
dotnet list package
.NET Framework vs .NET Core vs NetStandard
The original C# platform was .NET Framework, which included the WinForms UI toolkit and later WPF. It was Windows-only. Later, in order to make the C# language more cross-platform, the .NET Core platform was introduced. It had no UI toolit but could work on Windows, Linux and MacOS.
After .NET Core v3.1, its name was changed to just .NET. .NET 5, 6, 7 and and onward are still part of the .NET Core lineage and are not compatible with .NET Framework. Microsoft is sunsetting .NET Framework in that there will be no new versions, and they are only providing bug fixes for it. .NET is the way forward for the C# language; if you have a choice, you should avoid the .NET Framework.
In order to aid migration and provide some library compatibility between the two platforms, NetStandard was introduced. NetStandard is more a compatibility standard than a platform. NetStandard 2.0 is the last version supported by .NET Framework. You can see a compatibility table for NetStandard versions here.
.NET Framework also no longer supports the latest version of the C# language spec. It stopped at language version 7.3.
Zaber Motion Library currently only supports .NET, and by association NetStandard 2.1. It is no longer compatible with .NET Framework; we recommend all new C# projects use the latest .NET platform.
If you must use .NET Framework for legacy reasons, here are the last versions of Zaber Motion Library compatible with the last few Framework versions. You can select older versions when using the NuGet package manager in Visual Studio to add the dependency.
| .NET Platform | Last Compatible ZML Version |
|---|---|
| Framework 4.7.1 | 6.7.1 |
| Framework 4.6.2 | 5.2.2 |
| Framework 4.5 | 4.8.0 |
| NetStandard 2.0 | 4.8.0 |
You can see what version(s) are currently supported by looking at the Supported Platforms and Environments section.