The Gurobi connector for Solver Foundation has been updated for Gurobi 4.5. You can obtain the connector by visiting the Solver Foundation forum. Here are installation and usage instructions for the connector. These instructions have been verified on 32- and 64-bit versions of Windows 7 using Visual Studio 2010.

Installation

  1. Download the zip file Gurobi 4.5.zip. It contains:
    1. The GurobiPlugin.dll which connects the Gurobi 4.5 solver to Solver Foundation 3.0.
    2. 32- and 64-bit versions of the Gurobi 4.5 solver, found in the win32 and win64 directories.
    3. An updated version of the Gurobi Solver Programming Primer.
  2. Extract the zip file to a folder of your choice.
  3. Copy GurobiPlugin.xml and GurobiPlugin.dll into Program Files\Microsoft Solver Foundation\3.0.1.10599\Plugins (or "Plugins (x86)" for 32-bit systems). You may need administrator privileges to perform this action. If you do not know whether your system is 32- or 64-bit, from the Start menu, right click on "Computer" and select "Properties":

4. Select gurobi45.dll from the win32 or win64 folder and copy to the same folder. [corrected 7/28/2011]

Usage

Applications that use Solver Foundation and Gurobi need to be able to access the Solver Foundation assembly, the Gurobi plug-in assembly, and the Gurobi solver. The Solver Foundation assembly is accessed by adding a project reference in Visual Studio. To use Gurobi 4.5 in a Solver Foundation application built from Visual Studio 2010, perform the following additional steps.

  1. Open the project file associated with your application in Visual Studio.
  2. Add a project reference to GurobiPlugin.dll by browsing to the destination folder in Installation Step 3.
  3. Change the configuration file for your application. For example, to make Gurobi the default LP solver for Solver Foundation 3.0, change the app.config file for your project to the following:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="MsfConfig"
             type="Microsoft.SolverFoundation.Services.MsfConfigSection, Microsoft.Solver.Foundation, Version=3.0.1.10599, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             allowLocation="true" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication"
             restartOnExternalChanges="true" requirePermission="true" />
  </configSections>
  <MsfConfig>
    <MsfPluginSolvers>
      <MsfPluginSolver name="gurobi" capability="LP" assembly="GurobiPlugIn.dll"
                       solverclass="SolverFoundation.Plugin.Gurobi.GurobiSolver"
                       directiveclass="SolverFoundation.Plugin.Gurobi.GurobiDirective"
                       parameterclass="SolverFoundation.Plugin.Gurobi.GurobiParams" />
    </MsfPluginSolvers>
  </MsfConfig>
</configuration>

4. Ensure that the Platform Target for your application is set to Any CPU. This can be verified by right clicking on the project in the Solution Explorer, selecting "Properties", and navigating to the Build tab:

5. Build the application.

6. Copy gurobi45.dll from the destination folder in Installation Step 3 to the output directory for your application. This is typically found under bin\Debug. Copying gurobi45.dll to this location allows the connector to call the solver.

Your application should now be configured to use Gurobi 4.5 with Solver Foundation 3.0. Consult the Gurobi Solver Programming Primer for additional information.