Workflow with DLL

I was hoping that I could make use of DLLs to leverage the features of namespaces so that I can organise my codes and to facilitate distribution of code within team mates.

What I have done is this: I write the classes in an independent C# project. The classes include standalone classes and those that inherit from MonoBehaviour. I then compile the classes into DLL and copy them into Unity Project.

But it turns out that whenever I change something to the classes in the DLL, I need to re-compile and replace the DLL. Sometimes, the GameObjects may even loose reference to its scripts!

It also hinders my debugging process because now the errors within the DLL don’t show up. This becomes a massive hell in my workflow.

How can I improve on this so that I don’t have to always recompile my DLL file and replace the existing one?

But it turns out that whenever I change something to the classes in the DLL, I need to re-compile and replace the DLL.

I recommend you to set the ouptut-path of the DLL-Project to where you copy your DLL manually. Thus a re-compile will update the DLL automatically (you will get used to press [F6] every time before you switch back to Unity :wink: )

As agoshaderop mentioned, it’s also possible to make a Post-Build script to copy your DLL, but my approach allowed me to make a VS-PlugIn wich replaces the DLL-References in the Unity-VS-Projects with the actual VS-Projects within the solution :wink: