The ID prefix of this package has been reserved for one of the owners of this package by Prefix Reserved
.NET Standard 2.0

Requires NuGet 3.3.0 or higher.

dotnet add package Gurobi.Optimizer --version
NuGet\Install-Package Gurobi.Optimizer -Version
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Gurobi.Optimizer" Version="" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Gurobi.Optimizer --version
#r "nuget: Gurobi.Optimizer,"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Gurobi.Optimizer as a Cake Addin
#addin nuget:?package=Gurobi.Optimizer&version=

// Install Gurobi.Optimizer as a Cake Tool
#tool nuget:?package=Gurobi.Optimizer&version=

Gurobi Optimizer

This package contains the Gurobi Optimizer v10.0.2. It is compatible with .NET Standard 2.0 or higher.

For more information about Gurobi, please visit our website.

You need a license to solve models with Gurobi. To acquire a license for Gurobi, please visit our License Center.

For an easier start with Gurobi's .NET API, we provide an introduction to the .NET Interface (C#) in Gurobi and multiple .NET code examples showing most of Gurobi's features. You can find all information on methods available in the Gurobi's .NET API in our documentation.

For more information on installing the Gurobi NuGet package please refer to one of our Quickstart Guides:

If you encounter any issues during the installation process and could not find an appropriate answer in Gurobi's Knowledge Base, please open a Support Request through our Support Portal.

The following example formulates and solves a simple MIP model via Gurobi's .NET interface.

     maximize    x +   y + 2 z
     subject to  x + 2 y + 3 z <= 4
                 x +   y       >= 1
                 x, y, z binary

using System;
using Gurobi;

class mip1_cs
  static void Main()
    // Create an empty environment, set options and start
    GRBEnv env = new GRBEnv(true);
    env.Set("LogFile", "mip1.log");

    // Create empty model
    GRBModel model = new GRBModel(env);

    // Create variables
    GRBVar x = model.AddVar(0.0, 1.0, 0.0, GRB.BINARY, "x");
    GRBVar y = model.AddVar(0.0, 1.0, 0.0, GRB.BINARY, "y");
    GRBVar z = model.AddVar(0.0, 1.0, 0.0, GRB.BINARY, "z");

    // Set objective: maximize x + y + 2 z
    model.SetObjective(x + y + 2 * z, GRB.MAXIMIZE);

    // Add constraint: x + 2 y + 3 z <= 4
    model.AddConstr(x + 2 * y + 3 * z <= 4.0, "c0");

    // Add constraint: x + y >= 1
    model.AddConstr(x + y >= 1.0, "c1");

    // Optimize model

    Console.WriteLine(x.VarName + " " + x.X);
    Console.WriteLine(y.VarName + " " + y.X);
    Console.WriteLine(z.VarName + " " + z.X);

    Console.WriteLine("Obj: " + model.ObjVal);

    // Dispose of model and env
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Gurobi.Optimizer:

Package Downloads
OPTANO.Modeling.Gurobi The ID prefix of this package has been reserved for one of the owners of this package by

State of the Art Mathematical Programming Solver. This package ships all files to run Gurobi with OPTANO Modeling on win64 and linux64. No additional installation required. OPTANO.Modeling.Gurobi comes with a size-limited Gurobi license (Package OPTANO Modeling required). Please visit to obtain an unlimited license.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated 526 3/6/2023
10.0.1 1,545 1/31/2023
10.0.0 2,281 11/8/2022
9.5.2 1,027 8/24/2022