I think this is because there’s a bug in at least some of the newer Unity versions where code inside assembly definition assets no longer automatically references DLLs, even if Auto Reference
has been checked.
This can be fixed by adding this file to your Assets folder, and renaming it to csc.rsp
(without the .txt
suffix):
csc.rsp.txt (226 Bytes)
So it does work after adding that script… kinda.
If I have the new script file in place, and enable the overwrite I still get the Copy failure. If I force quit, then relaunch Unity, it starts with the overwrite enabled, however is throws the copy failure again. Hitting cancel allows me to cycle it again. Doing so doesn’t give me the copy error, but it does give me this. This seems to happen if I have a Debug statement in my code.
If I launch Unity without the overwrite or file in place. Then enable the overwrite, then the file. I get this when launching Visual Studio, but Debug.Log(() => foo);
is valid and correctly references the DLL.
Debug = Sisus.Debugging.Debug;
is still invalid though.
Additionally, closing Visual Studio and Unity, then trying to relaunch Unity results in it opening in safe mode, due to compile errors. Opening Visual Studio doesn’t show me anything that would throw a compile error though. I have to disable the script you provide before it will launch Unity normally.
For additional context, I’m using Unity 6000.0.25f1.
I think I’ve figured out what has probably been causing all the issues you’ve been encountering with the installers! The DLL installers were exporting files under the Assets folder, while the default DLLs are now located under Packages since the last version. This meant that when changing the option to replace the global debug class in project settings, there was an attempt to export a second set of DLLs, instead of replacing the original ones. That likely explains why the step to copy the DLL file failed - because another DLL with the same name already existed.
I’ll create a quick update to make the installers now output their contents under Packages as well, as they should.