Photon & Unity Question
Hi guys!
I’ve been struggling with a problem with Photon for the past two weeks now and I could really use some assistance getting this figured out.
I am attempting to learn how to set up a server application using Photon’s OnPremise Server SDK But I am hitting roadblocks right at the start! I am following Photon’s “App From Scratch” tutorial here :
https://doc.photonengine.com/en-us/onpremise/current/app-framework/an-app-from-scratch
But as soon as I create a public class ChatServer that inherits from ApplicationBase (Basically the first step in the tutorial) I get this error message: “Reference to type ‘MarshalByRefObject’ claims it is defined in ‘mscorlib’, but it could not be found”
mscorlib is already referenced by my visual studio by default! I attempted to reference it manually but that failed due to the pre-existing reference. I did, however, find that referencing Visual C++ 2015 UWP Desktop Runtime for Native Apps solves this issue. But that creates a new error telling me to change the targeted CPU but my visual studio won’t let me..
If anyone could please help me and let me know what I’m doing wrong or maybe teach me how to set up a Photon application I would be very grateful!! I’ve been struggling with this for so long and it is extremely frustrating! Thank you all in advance!
Or if anyone could point me in the direction of an easier way to set up an authoritative server?
Hi,
Add references to ExitGamesLibs.dll, Photon.SocketServer.dll and PhotonHostRuntimeInterfaces.dll
Did you follow this step? Can you confirm that you inherit from the correct ApplicationBase class provided in one the above mentioned libraries?
Yes, I have referenced those dll files from the lib folder of my Photon folder. Also, I am fairly certain that my class does inherit from the correct application base as when I created the class ChatServer, I had Visual Studio implement the using statement. Also, Visual Studio implemented the abstract class almost exactly as it is depicted on the Photon tutorial, so I am fairly certain that the reference is correct.
Could the errors lie with the fact that my visual studio is targeting Universal Windows Platform? And how do I fix that?
Yes, you have to create a class library. I honestly don't know if you can simply change this in your existing project but you can try this: inside VS right click on the certain project and select Properties. Inside the opened tab select Application and change the project's Output type to Class Library. Don't forget to save the changes. If it is still not working please try creating a new project / solution and select Visual C# > Class Library (.NET Framework).
Your answer
Follow this Question
Related Questions
How to detect server host has left - Host Migration 0 Answers
Instantiate with Photon 0 Answers
Unity Photon doesn't Spawn Player 0 Answers