Chanan Zupnick skrev den 2014-11-18 00:11:
> Hey, I am attempting to use the .NET DLL for VS 2013 and I keep getting
> a System.AccessViolationException whenever I call solver.NextSolution().
> The message says "Attempted to read or write protected memory. This is
> often an indication that other memory is corrupt." Below is the stack trace
Hi,
You need to keep a reference in your c# client to any Constraints or
other CLR-created objects which you add to the solver. Otherwise, your
CLR-created objects may be disposed by the garbage collector.
This is a consequence of mixing native code with managed code.
Regards
/ Otto Dandenell
On Tuesday, November 18, 2014 2:00:34 AM UTC-6, Otto Dandenell wrote:
Chanan Zupnick skrev den 2014-11-18 00:11:
> Hey, I am attempting to use the .NET DLL for VS 2013 and I keep getting
> a System.AccessViolationException whenever I call solver.NextSolution().
> The message says "Attempted to read or write protected memory. This is
> often an indication that other memory is corrupt." Below is the stack trace
Hi,
You need to keep a reference in your c# client to any Constraints or
other CLR-created objects which you add to the solver. Otherwise, your
CLR-created objects may be disposed by the garbage collector.
I am keeping variables. Will track the others also. Could just be in a 'simple' object collection?
On Saturday, November 22, 2014 12:17:04 PM UTC-6, Michael Powell wrote:
On Tuesday, November 18, 2014 2:00:34 AM UTC-6, Otto Dandenell wrote:
Chanan Zupnick skrev den 2014-11-18 00:11:
> Hey, I am attempting to use the .NET DLL for VS 2013 and I keep getting
> a System.AccessViolationException whenever I call solver.NextSolution().
> The message says "Attempted to read or write protected memory. This is
> often an indication that other memory is corrupt." Below is the stack trace
Hi,
You need to keep a reference in your c# client to any Constraints or
other CLR-created objects which you add to the solver. Otherwise, your
CLR-created objects may be disposed by the garbage collector.
I am keeping variables. Will track the others also. Could just be in a 'simple' object collection?
I'm not sure what else I need to track? I included IntExpr and constraints in the Clr-created-objects.
Chanan Zupnick skrev den 2014-11-18 00:11:
> Hey, I am attempting to use the .NET DLL for VS 2013 and I keep getting
> a System.AccessViolationException whenever I call solver.NextSolution().
> The message says "Attempted to read or write protected memory. This is
> often an indication that other memory is corrupt." Below is the stack trace
Hi,
You need to keep a reference in your c# client to any Constraints or
other CLR-created objects which you add to the solver. Otherwise, your
CLR-created objects may be disposed by the garbage collector.
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.