Trouble Shooting New Server | CService::OnException()

Kruga
edited December 2021 in Photon Server
Hi there,

Just having a problem trying to get the server to start up. I've followed the documents perfectly to my understanding.

Exception
3240: 23:54:31.160 - CService::OnException() - Exception: CManagedHost::RunApplicationInNewDomain() - Failed to run application: "MyPhotonServer", "MyPhotonServer.MyApplication" - Could not load file or assembly 'MyPhotonServer' or one of its dependencies. The system cannot find the file specified.

Directory Setup
    C:\Users\Public\Documents\Unity Projects\Server\MyPhotonServer\ C:\Users\Public\Documents\Unity Projects\Server\bin_Win32\ C:\Users\Public\Documents\Unity Projects\Server\lib\

As you can see it's 11:54 and I've had enough of trying for the night haha. :D

Now I'll go Start the PhotonControl program , then I'll load at the bottom of the screen, I'll click and go into the menu there.
1. To Photon ->Install Service -> Accept Admin to run app promt.
2. Back to Menu | To Photon -> Start Service ->wait 30 seconds -> Fail ?Continue or quit : I quit it.
3. Look in the log file and locate the same error.

I'm using VS2010, and all standard references. Have not changed anything for the default class library project. I didn't alter the code at all, Just copy/past what was on the Doc provide by the server SDK.
ExitGames-Photon-Server-SDK_v2-0-5 Server.

Toshiba Laptop 1700mhz
2k ram
I thought I had the 50 max lic, but I got the 30 day unlimited lic. :|

So to me, This should just run off the bat. Because I've not altered anything, and the system is just a basic, normal system...

So What am I doing wrong here ??
What can I do to fix this??

Regards
Kruga

Comments

  • License: you forgot to download the license and/or remove the trial one in the bin folder you use and where you put yours
  • It obviously tries to start your application but fails doing so.
    The setup file PhotonSocketserver.xml defined applications relative to the parent directory of its location. In your case:
    C:\Users\Public\Documents\Unity Projects\Server

    Photon will look into an application's "BaseDirectory" (relative to said path) for a "bin" folder. Do you have this? Is there your application's dll? In the config, your application's Assembly attribute must match the dll's name and the Type has to match Namespace.Type of the class that extends our Application class.
    Also make sure the dlls you referenced are in the MyPhotonServer\bin folder or where you expect them.

    If you can't find where it fails, please post the file-listing of your MyPhotonServer and the photonsocketserver.xml.
  • First off, Thanks to you guys for taking the time to answer me :D

    To dreamora :
      I Didn't play with any Licenses at all. I figured it would be fine for now, because I only downloaded the SDK about 1 week ago. So I should be within the 30 trail period for now.

    To Tobias :

    Here is the configuration that I've got here. :?

    Confile File :
      - <Applications Default="MyPhotonApp"> <Application Name="MyPhotonApp" BaseDirectory="MyPhotonServer" Assembly="MyPhotonServer" Type="MyPhotonServer.MyApplication" /> - <!-- LiteLobby Application --> <Application Name="LiteLobby" BaseDirectory="LiteLobby\LiteLobby" Assembly="LiteLobby" Type="LiteLobby.LiteLobbyApplication" /> - <!-- MMO Demo Application --> <Application Name="MmoDemo" BaseDirectory="MmoDemo" Assembly="Photon.MmoDemo.Server" Type="Photon.MmoDemo.Server.PhotonApplication" /> - <!-- CounterPublisher Application --> <Application Name="CounterPublisher" BaseDirectory="CounterPublisher" Assembly="CounterPublisher" Type="Photon.CounterPublisher.Application" /> - <!-- Flash & Silverlight Policy Server --> <Application Name="Policy" BaseDirectory="Policy\Policy.Application" Assembly="Policy.Application" Type="Exitgames.Realtime.Policy.Application.Policy" /> </Applications>

    The Directory Setup :

    ~\Server\bin_Win32\ *Photon*
    ~\Server\bin_Win32\log\ *Log FIles*
    ~\Server\lib\ *Library Files from Server SDK*
    ~\Server\MyPhotonServer\ *Project"
    ~\Server\MyPhotonServer\bin\ *Build dlls* -continueList
      ExitGamesLibs.dll ExitGamesLibs ExitGamesLibs.xml Photon.SocketServer.dll Photon.SocketServer Photon.SocketServer.xml PhotonHostRuntimeInterfaces.dll MyPhotonServer.dll MyPhotonServer

    OKOKOK , Just got it running.. As I was typeing this, I Figured I might have misunderstood the doc. The guy said to 'add' the
    &lt;Applications Default="MyPhotonApp"&gt;
      &lt;Application Name="MyPhotonApp" BaseDirectory="MyPhotonServer" Assembly="MyPhotonServer" Type="MyPhotonServer.MyApplication" /&gt; 
    &lt;/Applications&gt;
    

    But it should be 'replace', Because I rebuilt, deleted the log, and regenerated it, and it was saying it couldn't find the lite app. Which is good. So I reconfigured photon with out the extra apps, and it's running as I type.. :D I'll leave all that stuff above , because it might help other ppl.

    Just a quick question on the end of this. Do I have to keep everything in the same namespace also.

    Like now for example all this app is running under the MyPhotonServer namespace.

    but what if I wanted to run a namespace collection like this :
    Sever.Operations
    Sever.Game
    Sever.Controls

    If I set the Assembly="Server" in the config. This should pick up all the child namespaces also yes?
  • There is no problem with that if all dlls are present.
    The config just needs to know which class in which assembly implements PhotonHostRuntimeInterfaces.IPhotonApplication and PhotonHostRuntimeInterfacesIPhotonApplicationControl - that usually is a Photon.SocketServer.Application subclass
  • 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">
    <Application
    Name="MyPhotonApp"
    BaseDirectory="MyPhotonServer"
    Assembly="MyPhotonServer"
    Type="MyPhotonServer.MyApplication">
    </Application>
    </Applications>

    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.
  • I Got my Problem fixed, I just had confused the name of the namespace and the Name.DLL on my HD. But I'm unsure on the 64 bit prob

    Kruga
  • I create instance Windows_Server_2012_R2-1 on Amazon AWS. When I'm started photon service in not running.

    2468: 22:56:00.696 - CService::OnException() - Exception: CXMLConfiguration::LoadDocument() - Failed to locate required child element: "Instance" with tag: "Name" with value: "photonservice" - Source: "c:\Programs\PhotonWinServer\deploy\bin_Win64\PhotonServer.config"

  • hi, @Liova

    it seems that you took config from version 4 of sdk and use it for version 5. compare two configs, you'll see difference


    best,

    ilya