"error CS0103: The name 'PhotonEditorUtils' does not exist in the current context" on Photon Update

I updated my Photon version to Version 2.35 (from 2.18 or something old) but I'm getting the following error in my editor:

Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs(3191,18): error CS0103: The name 'PhotonEditorUtils' does not exist in the current context

A related thread here mentioned a similar issue could happen if there were missing files, but I did a fresh import overtop of my old files to be sure and the issue persisted.

I do have a PhotonEditorUtils.cs file in Assets/Photon/PhotonUnityNetworking/Code/Editor/PhotonEditorUtils.cs, but its namespace is `Photon.Realtime` and changing the namespaces didn't seem to work, since it still can't find the "Editor" part of the namespace.

I also tried reimporting the project because I noticed PhotonEditorUtils has `[InitializeOnLoad]`, but that didn't work.

Anyone have any suggestions?

Unity version 2019.4.28f1


  • Also tried Reimport All, no luck o=
  • I can comment out that one line (oh boy side effects!) but the demos aren't compiling either - These are errors that only appear after hitting "Play" for the first time. Super strange:

  • Tobias
    Tobias admin
    edited September 2021
    I'm sorry you are running into this.
    You are right, there are reports of this nature from time to time.

    This always boiled down to some package issues or a somewhat broken Editor version. We even had some Editor versions which did not update the local package cache with a new version from the store (despite saying so...).
    I would get a newer Unity version from the same LTS version you use. Then delete the store cache (they are somewhere in the user files) and download PUN 2 again to import in a new, empty project.

    Could you make it work?