I updated Microsoft Solver from V2.1 to 3.1 and it gives me error

Mirza Meghji 0 Reputation points
2023-06-05T21:20:21.3166667+00:00
Appreciate if you can help me with problem I am having with Microsoft Solver Foundation V3.0 and 3.1
I have been using  en_solver_foundation_standard_edition_V2.1_x86  for past 4 years and did not have any problems – it worked great 
Recently I updated to en_solver_foundation_standard_edition_V3.1_x86  version and same optimization problem which worked in V2.1 gives me
Error with V3.0 and V3.1  when  calling 
            oSolution.GetReport()  with ReportVerbosity.Sensitivity

            Dim report As Report = Nothing
             Dim reportSen As Report = Nothing
             report = oSolution.GetReport(ReportVerbosity.SolverDetails + ReportVerbosity.Decisions)
                  >>> with SolverDetails and Decisions it works fine get report  and NO Error                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                         ``                                                                                                                                           
                                reportSen = oSolution.GetReport(ReportVerbosity.Sensitivity)
                                reportSen = oSolution.GetReport()
                     >>>   with Sensitivity or  All report fails  and get error shown below           
                                Dim file As System.IO.StreamWriter
                                file = My.Computer.FileSystem.OpenTextFileWriter("c:\test.txt", True)
                                reportSen.WriteTo(file)
                                file.Close()

A first chance exception of type 'System.IndexOutOfRangeException' occurred in Microsoft.Solver.Foundation.dll
DefaultSource Error: 2 : Index was outside the bounds of the array.    at Microsoft.SolverFoundation.Services.PluginSolutionMapping.EnsureConstraintToVidMappingInitiated()
   at Microsoft.SolverFoundation.Services.PluginSolutionMapping.GetIndexes(Constraint constraint)
   at Microsoft.SolverFoundation.Services.LinearSolutionMapping.<GetVids>d__2c.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   at Microsoft.SolverFoundation.Services.LinearSolutionMapping.GetShadowPrices(ILinearSolverSensitivityReport sensitivityReport, Constraint constraint)
   at Microsoft.SolverFoundation.Services.LinearSolutionMapping.<GetAllShadowPrices>d__0.MoveNext()
   at Microsoft.SolverFoundation.Services.LinearReport.GenerateReportSensitivity(StringBuilder reportBuilder, IFormatProvider formatProvider)
   at Microsoft.SolverFoundation.Services.LinearReport.GenerateReportSolutionDetails(StringBuilder reportBuilder, IFormatProvider formatProvider, ReportVerbosity verbosity)
   at Microsoft.SolverFoundation.Services.LinearReport.ToString(ReportVerbosity verbosity, IFormatProvider format)
   at Microsoft.SolverFoundation.Services.Report.WriteTo(TextWriter destination)
   at SSIOptmizationSolverV4.cSolver.OptimizeSolution() in D:\VBNET2010\SSIOptimizationV4\SSIOptimizationSolverV4\Classes\cSolver.vb:line 473

I tried to find help on line but did not find anything related to above error and will very much appreciate if you can help me to 
Resolve this issue.

Community Center | Not monitored
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.