Failed to start application in AppDomain: 2 - The system cannot find the specified file

Options
gandalf
gandalf
edited April 2023 in Photon Server

development environment:

PhotonServer v5 sdk, vs2022, .NET Framework:.NET Standard 2.1

Error Message:

28072: 16:09:23.201 - ERROR: Failed to start application: "myPhotonServer" in app domain: 2

28072: 16:09:23.201 - CService::OnException() - Exception: CManagedHost::StartApplication() - Failed to start application in AppDomain: 2 - 系统找不到指定的文件。

25520: 16:09:23.201 - CManagedHost::OnDefaultAction() - OPR_AppDomainUnload - eUnloadAppDomain

Who can tell me what files are missing? Thank you!

The structure and citation of the project are as follows:


Output Directory:


The server main file is as follows:

using Photon.SocketServer;

using Microsoft.Extensions.Configuration;

namespace MyPhotonServer

{

  public class PhotonServer : ApplicationBase

  {

    static PhotonServer()

    {

    }

    public PhotonServer() : this(LoadConfiguration()){ }

    private static IConfiguration LoadConfiguration()

    {

      return null;

    }

    protected PhotonServer(IConfiguration configuration) : base(configuration){ }

    protected override PeerBase CreatePeer(InitRequest initRequest)

    {

      return new PhotonPeer(initRequest);

    }

    protected override void Setup()

    {

    }

    protected override void TearDown()

    {

    }

  }

}

PhotonServer.config //The configuration is as follows:

<Configuration>

 <!-- Multiple instances are supported. Each instance has its own node in the config file. -->

<Instance Name="MyPhotonServer"

   MaxMessageSize="512000"

   MaxQueuedDataPerPeer="512000"

   PerPeerMaxReliableDataInTransit="51200"

   PerPeerTransmitRateLimitKBSec="256"

   PerPeerTransmitRatePeriodMilliseconds="200"

   MinimumTimeout="5000"

   MaximumTimeout="30000"

   DisplayName="MyPhotonServer">


  <!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. -->

  <!-- Port 5055 is Photon's default for UDP connections. -->

  <UDPListeners>

   <UDPListener

    IPAddress="0.0.0.0"

    Port="5055"

    OverrideApplication="myPhotonServer">

   </UDPListener>

  </UDPListeners>


  <!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. -->

  <TCPListeners>

   <!-- TCP listener for Game clients on Master application -->

   <TCPListener

     IPAddress="0.0.0.0"

     Port="4530"

     OverrideApplication="myPhotonServer"

     InactivityTimeout="10000">

   </TCPListener>

  </TCPListeners>

  <Runtime

   Assembly="PhotonHostRuntime, Culture=neutral"

   Type="PhotonHostRuntime.PhotonDomainManager"

   UnhandledExceptionPolicy="TerminateProcess">

  </Runtime>

  <Applications Default="myPhotonServer">

   <Application

    Name="myPhotonServer"

    BaseDirectory="myPhotonServer"

    Assembly="MyPhotonServer"

    Type="MyPhotonServer.PhotonServer">

   </Application>

  </Applications>

 </Instance>

</Configuration>

Comments