The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

`PunRPC': is not an attribute class

2015-06-20 18:12:16

I just upgraded to the latest version of PUN (free, 1.56), now I keep getting these two errors:

  • error CS0616: `PunRPC': is not an attribute class.
  • The type or namespace name `PunRPCAttribute' could not be found

Does anyone know what that is? I don't know what namespace it is talking about or what I have to do to resolve this.

PS: loading PUN into a new project doesn't give any errors, but removing PUN from my existing project and then importing the new version does give it. I also can't get to the PUN wizard (network setup) as the scripts won't compile due to the errors

Edit: in trying to debug this i started to load all my assets into a new project with PUN already loaded. the error starts to show up when I import scripts. I didn't find a specific one yet since there are a couple that are referencing each other so I cant put them separately.

What is also strange is that the error is given in one of the scripts that is already in my project when there is no error. So no error shows, I add one of my own scripts, then there is an error in a script that was already there..

Exact error message: "Assets/Photon Unity Networking/UtilityScripts/InRoomChat.cs(71,6): error CS0246: The type or namespace name `PunRPCAttribute' could not be found. Are you missing a using directive or an assembly reference?"


2015-06-21 18:14:06

FOUND IT!! wow. Only took me about 4 hours. endsarcasm

I found out that System.Attribute was being inherited from by the RPC class. I also have a class called Attribute (not knowing that System also had a class named this way (yay for the coding newbs)). So now the compiler thought RPC inherited from my class (which is just a class for the player statistics) and went nuts over that.

I changed my class name and now all is well. (I know I could have made the inheritance more explicit but I preffered not having a similar problem later

2015-06-30 14:53:43

Sorry for the late reaction but you found your solution before we could react at all. Thanks for posting the update!

Mar Fox Games
2015-07-12 17:39:18

I have the same problem, could you pelease help me in order to solve it? Please tell me exactly what you did. Thanks

2015-07-12 17:57:48

I did exactly what I wrote above. Made an empty project. Imported pun. Then startedsimporting all of my project by very small parts. And then found when the problem started to occur. Then I found that I made a class "attribute" in my game which is also a class in the standard classes that come with C.

That's all, hope it helps youyou.

Mar Fox Games
2015-07-13 17:04:38

Sorry, my error is the following:
"No attribute with the name 'PunRPC' or 'PunRPCAttribute' was found (attribute names are case insensitive). " What can I do?

2015-07-16 15:38:51

I still can't reproduce the issue locally.
Please read this and reply to the thread, if that doesn't help.

Back to top