The type or namespace name 'Pun' does not exist in the namespace 'Photon'...

Options
I've looked everywhere and I cannot find a solution to this. I'm using Unity 2020.2 and PUN 2.27. I'm coding in Visual Studio 2017 (Community). I've also tried to resolve this by switching to Visual Studio 2015. I should note this problem suddenly manifested one when I was changing the namespaces of my OWN scripts. This caused the error, which also showed in the Unity Editor console. After I fixed (undid) the namespace changes to my scripts, the errors disappeared from the Unity Editor console, but persisted within Visual Studio; and continue to do so. I've tried deleting the .csproj files and reopening the project with no luck. Any immediate help with this issue would be GREATLY appreciated. I also should note the problem does not occur within Visual Studio Code (but we are not willing to use that IDE).

Comments

  • DRRosen3
    Options
    Solved it myself. So I was running into a common issue that whenever a new script is created within Unity, and opened, that triggers a new instance of Visual Studio to be initialized (even if there's already one for that project opened). The solution offered by the community was to uninstall the Visual Studio Editor package from the Unity Package Manager. This did indeed solve the issue of the multiple instances of VS being opened. When I reinstalled the VSE package, it got rid of this 'Pun' namespace error. Hope this helps anyone else suffering from these (issue). Seems I'll just have to suffer with multiple VS instances until Unity solves the VSE package issue.
  • Tobias
    Options
    Glad you could find a solution and thanks for the update! This might help indeed.