ukrishnas / LPSharp

LP solvers for optimization problems in C#, .Net, Windows platforms
MIT License
0 stars 0 forks source link

LPSharp.Powershell.dll dependency with System.Management.Automation not satisfied #5

Open ukrishnas opened 1 month ago

ukrishnas commented 1 month ago

Import-module LPSharp.Powershell.dll encounters unsatisfied dependency with System.Management.Automation.

import-Module -force .\PowershellConsole\bin\Release\net6.0\LPSharp.Powershell.dll

import-Module : Could not load file or assembly System.Management.Automation, Version=7.1.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 or one of its dependencies. The system cannot find the file specified.

$PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      22621  3880
ukrishnas commented 1 month ago

LPSharp requires System.Management.Automation to be a minimum version of 7.1.4. Please migrate to Powershell 7.

My attempt with pwsh.exe (Powershell7) succeeds.

import-Module -force .\PowershellConsole\bin\Release\net6.0\LPSharp.Powershell.dll

But set-solver fails to work because the CLP and GLOP solver assemblies are not loaded.

set-solver -create CLP -key clp
Set-Solver: The type initializer for 'CoinOr.Clp.coinwrap_clpPINVOKE' threw an exception.
set-solver -create GLOP -key glop
Set-Solver: The type initializer for 'Google.OrTools.Glop.LinearSolver.operations_research_linear_solverPINVOKE' threw an exception.

We are working to fix this. Until then, please use LPSharp.exe (documentation).