- Home /
C# .DLL not recognized on only one unity installation
Hi Guys. This is a real headscratcher to me. I have a dll file in Unity (of the YamlDotNet library). It works fine on about 7 different machines, all running Unity 2017.1.0f3 or the previous version (Unity 5.something). Now I have a new MacbookPro running OSX 10.12.5 and the same Unity version and Unity throws this error:
Assets/Scripts/steelCircus/Editor/InputEditor.cs(4,7): error CS0246: The type or namespace name `UnityInputConverter' could not be found. Are you missing an assembly reference? (UnityInputConverter is the namespace of the .dll)
To reiterate: There is absolutely no Problem on my other MacbookPro running OSX 10.11.6 and Unity 2017.1.0f3 (the same Unity version).
Both installations seem to be 64 bit. Using Terminal and running "file" command on the "Unity" file inside the MacOS folder of the package yields: "Mach-O 64-bit executable x86_64" in both cases. I tried moving the dll into the root "Asset" folder into the "Asset/Plugins" folder into the folder with the c# file that uses it, out of the folder. Nothing has any effect. Trying to manually add the DLL to the ".NET Assembly" tab of MonoDevelop yields the message: "File: 'Blah/Blah/UnityInputConverter.dll' is not a valid .NET Assembly"
If anyone has any ideas what I can try, I'm happy to hear them. Thanks.
Answer by Bunny83 · Jul 21, 2017 at 02:05 PM
I guess you talk about this DLL? Have you compiled the DLL yourself or have you downloaded it somewhere? When MonoDevelop complains that it's not a valid .NET assembly the file might be corrupted.
Also note that the DLL seems to be an editor extension (as it references the UnityEditor.dll) so the DLL must be inside an editor folder.
Just to clarify: putting the file in the appropriate folder in your unity project's Assets folder, will automatically adjust the c# project to include the reference to the DLL. (The c# "solution" consists of both an editor and non-editor projects. if you put the DLL in an editor folder, the reference will be added to the editor project, otherwise the reference is added to the non-editor project.) Any references you add to the c# project manually will be automatically overwritten/deleted.
I feel like sometimes I've had to close and reopen the c# IDE, after adding a DLL, to refresh the c# project references.
Yes sometimes that's necessary. However for me VS actually wants to reload the solution even too often which is kinda annoying.
"However for me VS actually wants to reload the solution even too often which is kinda annoying." That never happens to me: only when I intentionally make some kind of change to the files or directory structure of the open project, does it happen. This makes me suspect some process is changing a file/folder without your intent. If that's indeed the case, you could use process monitor, and with some filters, see what process is actually doing the modifying. (If it's annoying enough to troubleshoot.) https://technet.microsoft.com/en-us/sysinternals/bb896645
Your answer
Follow this Question
Related Questions
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
Unity Cloud Build error with .dll 3 Answers
The program can't start because UnityPlayer.dll is missing from your computer. 2 Answers
Unable to resolve reference 'office' in Microsoft.Office.Interop.Excel.dll 1 Answer