CManagedHost::RunApplicationInNewDomain() - Failed to run ap

edited September 2010 in Photon Server
Hello! We have a problem with Photon on our new server under 64-bit Windows 2008 R2
(our old server with 32-bit Windows 2008 does not have such problem)

When compiled an example from "photon-blank-server-setup.pdf" and tried to run it.
Our config in PhotonSocketServer.xml:
<Applications Default="MyPhotonApp">

And we've got an error message in logs:
2444: 12:54:34.062 - CService::OnException() - Exception: CManagedHost::RunApplicationInNewDomain() - Failed to run application: "MyPhotonServer", "MyPhotonServer.MyApplication" - Exception has been thrown by the target of an invocation.
2444: 12:54:34.062 - Server shutting down...
2444: 12:54:34.062 - Shutting down ENet host...
2444: 12:54:34.062 - Disconnecting all peers...
2444: 12:54:34.062 - Shutting down socket servers...
2444: 12:54:34.062 - Shutting down ENet thread pool...
2444: 12:54:34.062 - Shutting down business logic thread pool...
2444: 12:54:34.062 - Shutting down I/O thread pool...

We tried to launch "Lite" example and got the same error message.


  • Boris
    Seems that there is an exception in either the MyApplication constructor or a static variable that is used.
    Which binaries do you start?
    What does your folder structure look like?
  • I did everythig according to the manual.
    Application folder is "C:/PhotonServerSDKv2/deploy/MyPhotonServer"
    I start Photon from "C:/PhotonServerSDKv2/deploy/bin_x64"
    I tried different ways to start Photon: as application using PhotonControl.exe and also i tried to install photon as service and start it using _service.start.cmd or via Services List in Administrative tool. In every case i got the same error.
  • Boris
    the app binaries are in "C:/PhotonServerSDKv2/deploy/MyPhotonServer" or "C:/PhotonServerSDKv2/deploy/MyPhotonServer/bin" ?
  • Boris
    when compiling, was it for any platform or just 32bit? just making sure...
  • Boris
    and did you add all 4 references to the project?
  • The app binaties are in "C:/PhotonServerSDKv2/deploy/MyPhotonServer/bin". I just copied the project as it was created.

    Yes, I added all 4 references: PhotonHostRuntimeInterfaces.dll, ExitGamesLibs.dll, log4net.dll, Photon.SocketServer.dll

    I tried different compile options including "Any Cpu" and "x64"
  • Boris
    very odd.. I cannot reproduce the problem :(
    and that the same code worked on 32bit it's even more strange.
    can you please send me a PM with your compiled stuff?
    I would like to find out what kind of exception is being thrown.
  • It seems that the problem has benn fixed.
    just .NET framework 3.5 was not installed on the server.

    Thanks Boris for help!