문제

I can't make LPSolvePlugIn for MSF work on a 64 bit OS. (inside a c# dll hosted called from asp mvc 3 application)

Is there a specific version for this? Should I build my application targeting x86? Should I rebuild the solver plugin from source code to target x64?

I'm at a loss, there is not much documentation on the plugin, and the latest code seems to target MSF 2.0.7 (i currently have 3.0.1 or 3.0.2)

Any help would be appreciated. I'll check on monday and add more info if needed.

Thanks

도움이 되었습니까?

해결책

I finally worked it out.

I got my hands on MSF standard 3.0.2 64bits. Compiled the LPSolvePlugin code (from http://www.peno.be/MSF/) in a 64bit machine using lpsolve55.dll for 64 bits (got it from http://sourceforge.net/projects/lpsolve/)

Copied the lpsolveplugin.dll and the lpsolve55.dll to the plugins folder of msf

added the following in the web.config of my webservice (can be added to the app.config of a desktop application if necesary)

<configSections>
  <section name="MsfConfig"
         type="Microsoft.SolverFoundation.Services.MsfConfigSection, Microsoft.Solver.Foundation, Version=3.0.2.10889, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
         allowLocation="true"
         allowDefinition="Everywhere"
         allowExeDefinition="MachineToApplication"
         restartOnExternalChanges="true"
         requirePermission="true" />
</configSections>
<MsfConfig>
  <MsfPluginSolvers>
    <MsfPluginSolver name="LpSolveLP"
                   capability="LP"
                   assembly="LpSolvePlugIn.dll"
                   solverclass="SolverFoundation.Plugin.LpSolve.LpSolveSolver"
                   directiveclass="SolverFoundation.Plugin.LpSolve.LpSolveDirective"
                   parameterclass="SolverFoundation.Plugin.LpSolve.LpSolveParams" />
    <MsfPluginSolver name="LpSolveMIP"
                   capability="MILP"
                   assembly="LpSolvePlugIn.dll"
                   solverclass="SolverFoundation.Plugin.LpSolve.LpSolveSolver"
                   directiveclass="SolverFoundation.Plugin.LpSolve.LpSolveDirective"
                   parameterclass="SolverFoundation.Plugin.LpSolve.LpSolveParams" />
  </MsfPluginSolvers>
</MsfConfig>

and it worked.

Hope it helps!

다른 팁

I have a VS 2012 Express and I was getting a "BadImage" error with the lpsolve55.dll / LpSolvePlugIn.dll.

I then compared to the C# example (lp_solve_5.5.2.0_cs.net.zip at http://sourceforge.net/projects/lpsolve/files/lpsolve/5.5.2.0/) and found out that, as soon I changed the project Properties / Application / Target Network from 4.5 to ".NET Framework 4.0" it started working :-)

I tried that for a while before giving up. First you are probably using xpress edition of MSF. There are some limits that you will reach quickly. As far as getting a pro or education version, good luck. I could not. I could not even find a place where to buy 3.0.1 as MSF has been deprecated from MS. I finally decided to call the original c++ code that you can find here http://sourceforge.net/projects/lpsolve/files/lpsolve/5.5.2.0/ you will find some example about how to call from C#. Another advantage is that there is no limitations. Let me know if U managed to sort it out with MSF 3.0.1...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top