I put common C# code into projects external to Unity. These projects can contain MonoBehaviours. I use a post build event to copy them into my Unity Assests folder. Then in Unity I can attach these scripts to Game Objects and everything works as expected. Finally, all of this is stored in a Git repository with visible meta files and forced text serialization.
The external DLLs (as in the literal DLLs) are not stored in repository, but the source code for the projects are. New copies of the DLLs are copied to Unity Asset folder by rebuilding the solution. This way I can keep updating those projects and easily have new DLLs imported to Unity without constantly replacing binaries in Git.
This works for my main computer, but when I try cloning the repository to another computer I run into problems. I’m able to build everything just fine, but all the MonoBehaviours from my externally built DLLs now show up as Missing Mono Scripts, even though those DLLs were successfully copied to the Assets folder. What did I miss?
Add the .meta files to your source control so they get transferred. If Unity regenerates them, they will end up with different GUIDs that won’t match the references to them in your Unity project.
In similar projects I’ve also had timing issues. Its important to make sure that the meta file and the dll are both present when opening Unity. If you are missing the meta file, Unity will reimport the dll and create a new meta file. If you are missing the dll, Unity will delete the extra meta file.
You are absolutely correct, I had the .meta files for the rest of my project but was accidentally ignoring everything in the Build folder, including the meta files for those DLLs. Setting it to ignore the DLLs but include the .meta files fixes my problem.