Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  BadImageFormatException in Web application when using CPLEX callable lib

    Posted 09/30/10 01:08 PM

    Originally posted by: CplexUser


    Hi,

    I tried to move my .Net based windows application to a web server to support a research to help people study how their management decision would influence the environment. I used ILOG cplex to do some background modeling when people click certain button on the internet.

    Everything works fine so far except I cannot run the CPLEX callable library anymore. Anytime it reaches the code:

    env = cplex64.CPXopenCPLEX(status)

    The Vb.net will throw a exception like:

    "System.BadImageFormatException was unhandled by user code
    InnerException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"

    But when I run the window desktop version of the program, it works just fine when reaching this code.

    Please help! I spend huge amount of time in trying to make this work, but seems everthing would become meaningless if ILOG won't support web based modeling.

    Yu
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: BadImageFormatException in Web application when using CPLEX callable lib

    Posted 09/30/10 03:54 PM

    Originally posted by: SystemAdmin


    The web server is also a 64-bit system?

    /Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: BadImageFormatException in Web application when using CPLEX callable lib

    Posted 09/30/10 04:10 PM

    Originally posted by: CplexUser


    Yes, I am using a Windows 7 64 bits computer. I am also using Visual Studio Development Server instead of the Windows IIS.

    I found if I set the advanced compile option in visual studio to X86 or AllCPU, the website and the embeded button would show up correctly, but CPLEX would report the BadImageFormateException error after I click the button.

    But if I change the advanced compile option to X64, then even the website itself would show error as: "Exception Details: System.BadImageFormatException: Could not load file or assembly 'webApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format." In this case, it won't even show the button I want to click to solve the model.

    Thanks for help me with it!

    Yu
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: BadImageFormatException in Web application when using CPLEX callable lib

    Posted 09/30/10 05:10 PM

    Originally posted by: SystemAdmin


    Can you run CPLEX interactive in a shell on the server? (I'm just trying to confirm that CPLEX is correctly installed on the server.)

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: BadImageFormatException in Web application when using CPLEX callable lib

    Posted 09/30/10 05:32 PM

    Originally posted by: CplexUser


    Yes, Paul. It works either through the shell or through another desktop application calling the libarary directly through VB.net in the same computer.

    It seems if I call the library through the desktop version of VB.net directly, it works; but if I take a loop by going through the ASP.net --> Website --> Click a Button --> call VB.net sub routin--> call cplex lib, it crashes.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: BadImageFormatException in Web application when using CPLEX callable lib

    Posted 09/30/10 06:16 PM

    Originally posted by: SystemAdmin


    > CplexUser wrote:

    > It seems if I call the library through the desktop version of VB.net directly, it works; but if I take a loop by going through the ASP.net --> Website --> Click a Button --> call VB.net sub routin--> call cplex lib, it crashes.

    I don't know much about VB.net -- a condition I am happy to maintain -- but is there any chance that the ASP server (or the DotNet framework it uses) is a 32-bit version, and consequently when you go through the web site you end up with a 32-bit programming trying to use a 64-bit library?

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: BadImageFormatException in Web application when using CPLEX callable lib

    Posted 09/30/10 06:28 PM

    Originally posted by: CplexUser


    VB.Net has been fine with the 64bit cplex for long time, but ASP.NET seems have trouble. They were actually comming from the same install package. I am fine with using the 32 bit cplex if it can use more than 4G of memory. The 32 bit cplex seems work much stable than the 64 bit version, at least together with the ASP.NET. I will give the 32 bit a try.

    Thanks.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: BadImageFormatException in Web application when using CPLEX callable lib

    Posted 05/03/17 02:46 AM

    Originally posted by: spyknight2004


    Could you pls guide me how can I prepare an MVC WebApllication to use CPLEX libraries?
    how can I add required DLLs? How can I add linkers? ...


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: BadImageFormatException in Web application when using CPLEX callable lib

    Posted 05/09/17 09:19 AM

    Same question asked here.

    Please don't ask the same question in many places. Please also start a new topic rather than coming back to very old topics that are rather unrelated to your question.


    #CPLEXOptimizers
    #DecisionOptimization