"The associated script can not be loaded."
That's the error I gotin Inspector when I clicked a GameObject in Hierarchy.
Where is my script, you ask.
It is in a standalone .NET assembly (.DLL). Any ordinary .NET DLLs can be used to contain plain vanilla C# classes that inherit MonoBehavior, and assigned to objects in Unity editor! (I like this arrangement so that I don't end up having too many script files in Unity environment.)
To understand this problem, I changed the editor's serialization from "Mixed" to "Force Text".
Why? Because files such as "myscene.unity" are binary format and it was hard to understand what was going on (you could still search binary file but it wasn't still clear how an Unity project is organized)
Here is the settings:
Anyhow, the reason why I got this error is because the GUID generated and stored in the DLL's meta file is different on each developer's machine, and I did not check in neither DLL nor its meta file. So Unity editor wasn't able to resolve the reference.
I opened myscene.unity and found a corresponding script reference.
--- !u!114 &1185866689
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1185866687}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1348454995, guid: 50b34ac0c06dffa4686286b9fc4fe8c1, type: 3}
m_Name:
m_EditorClassIdentifier:
Address: localhost
Port: 8080
Now, open a .meta file of the DLL that hosts the script class (MonoBehavior derived class)
fileFormatVersion: 2
guid: 50b34ac0c06dffa4686286b9fc4fe8c1
MonoAssemblyImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
userData:
The GUID values are the same. This is good. This is how Unity editor resolves script references.
I was getting an error because I did not check-in my DLLs but instead, expected each developer to build a DLL on his/her own machine. This caused a different GUID generated and stored in a .meta file, making it impossible for Unity editor to do the "wiring up".



