Table of Contents

Setting Up Your Project

Package Reference

To use LpSolveDotNet, you will first need to reference its NuGet package from your project:

<PackageReference Include="LpSolveDotNet" Version="4.x.x"/>
Tip

If you end up using one of the LpSolveDotNet.Native.* packages below, because they have a reference to the LpSolveDotNet package, the reference above becomes redundant.

Library Initialization

The second step in setting up your project is to initialize the LpSolveDotNet library. Because it is a wrapper on top of a native library written in C, it needs to load the native library before we can use LpSolveDotNet which is described in the tabs below. If you encounter issues with the solutions in the tab for your platform below, you might want to look at the Other .NET Targets tab for a solution instead.

In your project file:

<PackageReference Include="LpSolveDotNet.Native.win-x64" Version="4.x.x"/>

In your code:

// Call once per process, before any other usage of LpSolve
LpSolve.Init();