Search code examples
c#visual-studiomathematical-optimizationor-tools

How to install Google OR-Tools for C# in Visual Studio 2019


I am new to C# and Visual Studio, only did a bit of programming in Python with Anaconda and don't have an IT-background. So please excuse my fairly basic questions.

I am supposed to construct an optimization tool (i.e. the goal seeker from MS Excel) in C#. From my understanding I need an external package, so I looked for an open-source solution and found:

Numerical seemed to be outdated, because at some point they migrated to GitHub, but I could not find it there. For Microsoft Solution Center I found a post, where someone claimed it doesnt get any updates anymore. So I finally discovered OR-Tools and downloaded/installed it according to the website.

What the website does not explain is how I connect the package with Visual Studio. I can't seem to find a "manually install"-button in the extensions-manager. In Python/Anaconda I would usually find a pip installer command for the console. Afterwards I could use the package with the import statement. How does it work in Visual Studio 2019?


Solution

  • We provide Nuget .Net Standard package for OrTools so you just need to add it as PackageReference in your csproj file.

    ref:

    warning: Since .Net Google.OrTools is a native package wrapping the C++ library OR-Tools, you'll still need the VS 2019 C++ Reditributable...