[SOLVED] Failed to start application in AppDomain: 2

Options
shanefarris
edited September 2012 in Photon Server
I am able to run the server and have a game use it on my local machine (Win 7), but when I take the same directory where the server assemblies are and put them on a Windows 2008 server, it fails.

Here is the complete log:
1776: 18:17:54.154 - ---
1776: 18:17:54.154 - Server Starting...
1776: 18:17:54.154 - Config File: C:\Users\Administrator\Desktop\PhotonBBR\BBR Photon Win 64 Bin - Copy\PhotonServer.config
1776: 18:17:54.154 - Not using performance counters as they are not currently installed. Run the service with /InstallCounters to install them.
1776: 18:17:54.169 - About to load runtime: PhotonHostRuntime.PhotonDomainManager from PhotonHostRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=02C301B61B060C4D
1776: 18:17:54.169 - About to load CLR - versions available:
1776: 18:17:54.169 - v2.0.50727
1776: 18:17:54.169 - No preference in configuration file, will load latest.
1776: 18:17:54.169 - About to load version: "v2.0.50727"
1776: 18:17:54.169 - Loaded version: "v2.0.50727"
1776: 18:18:00.826 - Photon host runtime loaded
1776: 18:18:02.232 - License is valid.
1776: 18:18:02.232 - Licensed for unlimited concurrent connections.
1776: 18:18:02.232 - Max Reliable Data In Transit (awaiting ACKs) per peer : 16384 bytes
1776: 18:18:02.232 - Per peer bandwidth limit
1776: 18:18:02.232 - Transmit Rate Limit: 128 KB/Sec
1776: 18:18:02.232 - Limit period: 250ms
1776: 18:18:02.232 - Limit per period: 32768 bytes
1776: 18:18:02.232 - Max queued data for transmission per peer: 65536 bytes
1776: 18:18:02.232 - Minimum retransmit timeout: 200
1776: 18:18:02.232 - Minimum ENet timeout: 5000ms
1776: 18:18:02.232 - Maximum ENet timeout: 30000ms
1776: 18:18:02.232 - ENetHost: Using Timer Wheel
1776: 18:18:02.232 - About to load application: NetSync from Photon.NetSyncObject.Server
1776: 18:18:02.232 - Auto restart is enabled for application
1776: 18:18:02.232 - Application will restart 10000ms after the last change detected
1776: 18:18:09.466 - ERROR: Failed to start application: "NetSync" in app domain: 2
1776: 18:18:09.466 - CService::OnException() - Exception: CManagedHost::StartApplication() - Failed to start application in AppDomain: 2 - Could not load file or assembly 'Photon.NetSyncObject.Server' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
1776: 18:18:09.466 - Server shutting down...
1776: 18:18:09.466 - Shutting down ENet host...
1776: 18:18:09.466 - Disconnecting all peers...
1776: 18:18:09.466 - Shutting down socket servers...
1776: 18:18:09.466 - Shutting down ENet thread pool...
1776: 18:18:09.466 - Shutting down business logic thread pool...
1776: 18:18:09.466 - Shutting down I/O thread pool...
1516: 18:18:09.481 - CManagedHost::OnDomainUnload() - 2
1776: 18:18:09.481 - Flushing ENET buffer allocator...
1776: 18:18:09.481 - Flushing TCP buffer allocator...
1776: 18:18:09.481 - Flushing stream socket allocator...
1776: 18:18:09.481 - Flushing datagram socket allocator...
1776: 18:18:09.481 - Destroying ENet thread pool
1776: 18:18:09.481 - Destroying TCP inactivity timer
1776: 18:18:09.481 - Destroying Business logic thread pool
1776: 18:18:09.481 - Destroying servers
1776: 18:18:09.481 - Destroying ENet host
1776: 18:18:09.481 - Destroying CLR dispatcher
1776: 18:18:09.481 - Destroying CLR applications
1776: 18:18:09.481 - CManagedHost::OnCLRDisabled()
1776: 18:18:09.497 - Destroying I/O thread pool
1776: 18:18:09.497 - Destroying ENet buffer allocator
1776: 18:18:09.497 - Destroying TCP buffer allocator
1776: 18:18:09.497 - Destroying TCP socket allocator
1776: 18:18:09.497 - Destroying ENet socket allocator
1776: 18:18:09.497 - Destroying performance counters
1776: 18:18:09.497 - Shutdown complete...


I am running 2.0.9.1 version of the server because when I run the latest, it says that my license has expired. I've copied the entire contents that is required to run the server. I know this error has been posted before, but I haven't been able to find a post that has a solution for me.

Comments

  • dreamora
    Options
    If you need to run 2.x then you don't have a photon 3 license.
    Best contact the support on that matter as I believe that all 2.x licenses are being upgraded for free.

    as for your problem. as it points out you try to use an app built against a newer version of photon in an old one. that will not work.

    move the source folder over and update the references where needed and rebuild it and it will work (assuming the application was photon 2.0.x to begin with)
  • I am not building anything, I am copying the sever and the assemblies from one server onto my machines, testing it successfully, and then putting them on a different server, that is not able to run it.
  • Free licenses are available from http://exitgames.com/download for you to try.
  • This has nothing to do with licenses at all. :)

    Please install .NET Framework 3.5, incl. SP1, and / or .NET Framework 4 on your server machine.
  • Yeah I didn't think so, so I gave up on this post, wish I would have seen your reply sooner. I did in fact install .net 4.0 and now it works, so I wanted to come back here and let everyone know that fixed it for me.

    Note to all,
    By default if you are using Win server 2008 sp1 image on Azure, the .net 3.5.1 install will not be sufficient, you will need to download and install .net 4.0 as well.