Building and running the example

The C# and Visual Basic example directories (<installdir>/examples/c# and <installdir>/examples/vb) contain a number of examples. We encourage you to browse and modify them in order to become more familiar with the Gurobi .NET interface. We also encourage you to read the Gurobi Example Tour for more information.

On Windows, you can use the CS_examples_2015.sln, CS_examples_2017.sln, or CS_examples_2019.sln solution files in <installdir>/examples/build to build and run the example with Visual Studio 2015, 2017, or 2019, respectively. Clicking on the mip1_cs project, and then selecting Run from theBuild menu will compile and run the example.

Alternatively, you can find a .NET Core 2 based project file dotnetcore2.csproj under <installdir>/examples/build/DOTNETCore2 together with the mip1_cs example. By executing dotnet run in this directory you can build and run the mip1_cs example. (It is possible to exchange this example with any other example provided in <installdir>/examples/c# by replacing the file mip1_cs.cs with the corresponding .cs example file.)

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.