Search Issue Tracker
Fixed in 2017.1.X
Votes
3
Found in
5.5.0f3
Issue ID
863274
Regression
No
External dll classes are not recognized if they inherit NetworkBehaviour
Reproduction steps:
1. Open project attached (NetworkBehaviourBug.zip)
2. Go to Assets and check TheEngine.dll.
Expected result: TheEngine class NetworkBehaviourTest will be recognized.
Actual result: TheEngine class NetworkBehaviourTest is not recognized.
Workaround:
Add UnityEngine.Networking.dll under TheEngine.dll and reimport TheEngine.dll.
Reproduced on: 5.3.7p3, 5.4.4f1, 5.5.0p3, 5.6.0b3.
Note: class inherits NetworkBehaviour. For best experience, users should not be forced to add UnityEngine.Networking.dll in order to get their scripts recognized.
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Benzor
May 11, 2017 18:48
To clarify, the workaround is to copy the UnityEngine.Networking.dll such that it's beside your custom TheEngine.dll in the project's folder structure. You can automate this with a post-build step from e.g. Visual Studio.
http://stackoverflow.com/questions/49972/in-what-order-are-locations-searched-to-load-referenced-dlls
deemen
Jan 24, 2017 15:17
I can confirm this issue occurs in 5.5.0p4. The suggested workaround does cause Unity to correctly recognize the NetworkBehaviours, however it's important that the UnityEngine.Networking.dll be correctly flagged as an editor-only DLL otherwise it will cause errors when building the player.
Also note that SyncVars will not work correctly since the UNetWeaver does not run on DLLs (see: https://forum.unity3d.com/threads/networkbehaviour-in-external-dll.368167/)