当使用Gurobi。net API时,您可能会看到一个糟糕的图像格式异常(System.BadImageFormatException)第一次访问Gurobi net程序集。
Gurobi . net组装(如gurobiXX.NET.dll)编译AnyCPU首选(64位)。您的应用程序需要确保适当的本地库(gurobiXX.dll)在运行时用于目标平台。
BadImageFormatException发生如果你把32/64位库的时候。net运行时加载本地库。在运行时,每个. net应用程序是JIT编译为一个本机x64或x86应用程序根据系统。应用程序需要使用本地库(比如Gurobi),我们建议显式地创建和使用x64和x86构建配置和删除“AnyCPU”构建配置在Visual Studio。
评论
0评论
文章是关闭了评论。