Getting Started
This tutorial if for dotnetcore users. If you are trying to create a .NET Framework project, skip to the end of this page.
- Install .NET Core SDK for your operating system
- Open your favorite terminal
- Setup Project and install library
dotnet new console -o reliance_sample
cd reliance_sample
dotnet add package PTIRelianceLib
- Open Program.cs in your favorite editor and replace the code with the following:
using System;
using PTIRelianceLib;
namespace reliance_sample
{
class Program
{
static void Main(string[] args)
{
using(var printer = new ReliancePrinter())
{
var rev = printer.GetFirmwareRevision();
Console.WriteLine("Firmware revision: {0}", rev);
}
}
}
}
Important
Linux users, please make sure libusb is installed before proceeding
- Execute
dotnet run
Results
.NET Framework 4.6.1+ or other netstandard2.0 Framework
We recommend first creating a console application to get a feel for the library. Once this works, you can then create a GUI application (WPF, WinForms, etc.). This example assumes the latest version of Visual Studio is being used.
Ensure you have a compatible framework installed
Create a new C# desktop project, select Console
In the project settings, make sure .NET Framework 4.6.1+ is selected
Click create project
Once project is generated, add this library to your application
Install-Package PTIRelianceLib
Copy the sample code from above into your application
Build, run, and done!