Namespace 'ExitGames' could not be found.

Options
This has been asked before, but the accepted answer was that the user started all over again and it just worked, which obviously isn't much help.

My project runs fine in Unity, but I can't attach visual studio because this doesn't compile because of a missing reference to 'ExitGames', which I assume would be in the dll 'Photon3Unity3D.dll'?
I have downloaded the latest Photon Realtime and in VS have clicked 'Include in Project' everything in PhotonLibs, PhotonRealtime and PhotonUnityNetworking. Including these allowed it to recognise 'Photon.Pun' and 'Photon.Realtime', but not 'ExitGames'.
I couldn't see a way to 'add references' specifically to this, or to use Nuget to do it.
This doesn't stop me developing on the project, but losing the ability to debug code in visual studio is a problem.
I'm using Unity 2017.3.1, and Visual Studio Community 2015 (14.0). I can upgrade if required.

Thanks in advance. Photon is awesome.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @stuartbray,

    Thank you for choosing Photon!

    I see two possible issues here:

    1. An issue with your Visual Studio integration with Unity as you don't need to set up the Visual Studio solution yourself as this is done by Unity for you.
    2. Confusion of which Photon product to use. If you download and import PUN2 from the Unity Asset Store no need to download anything else as it includes Photon Realtime. If you download Photon Realtime Unity SDK from our website then it's another story, you need to get rid of everything else and keep it only. So maybe you have a conflict of Photon SDKs.

    So what I suggest is to start with a clean empty fresh project.
    Make sure Visual Studio for Unity is installed.
    Import PUN2 only.
  • Ok, thanks, I'll try that and feed back. Cheers.
  • Actions taken:
    1) Start new Test project, just import PUN2, build in VS: all good.
    2) Stripped all PUN out of real project, build in VS: all good.
    3) Import PUN2 into real project, build in VS: all good.
    4) Uncomment all my PUN related code, build in VS: all good.

    Didn't have to "Include in project" anything at all.
    Maybe my code was in a non-compiling state when I did the import?
    Maybe switching to VS 2017 helped?
    Maybe I had manually copied in PUN code when I added PUN to this project.

    Either way, it all looks good now. Thanks for you help.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Maybe my code was in a non-compiling state when I did the import?
    Oh yes that could be it.
    Thanks for the update.
    I'm glad it works now.