Hello,
I need some help getting OrTools into my .NET C# project. I have followed the instructions to install from binary but I am not sure what to do next. I see that there are nuget packages in the binary installation, however when I add them via nuget package and reference them to my project I get one of the following errors:
When using the "Google.OrTools" package reference:
System.BadImageFormatException: 'Could not load file or assembly 'Google.OrTools, Version=7.2.6977.0, Culture=neutral, PublicKeyToken=77370d3086a71853' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)'
When using the "Google.OrTools.runtime.win-x64" package reference:
"System.TypeInitializationException: 'The type initializer for 'Google.OrTools.LinearSolver.operations_research_linear_solverPINVOKE' threw an exception.'"
Inner exceptions:
- TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception
- DllNotFoundException: Unable to load DLL 'Google.OrTools.runtime.win-x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I was able to successfully run tools\make test_dotnet in the directory that I unpacked the binary. The instructions stop here however, and I'm a little lost on how to proceed. Any help would be appreciated.
Thanks.