Quantcast
Channel: Questions in topic: "assemblies"
Viewing all articles
Browse latest Browse all 145

[iOS] Managed DLL cannot find references to .Net framework DLLs

$
0
0
Question -------- I need to include in my project a set of open-source libraries for making queries against OData REST APIs. The libraries come from Microsoft (https://www.nuget.org/packages/Microsoft.OData.Client) and target .Net 4.5. I can include the libraries in editor and on UWP with no issues. However, when I try to make a build for iOS I start getting errors saying:
ArgumentException: The Assembly System.Diagnostics.Tools is reference by Microsoft.OData.Edm(…) but the DLL is not allowed to be included or could not be found.
Looking up similar questions I found that copying that required DLL from the Mono Facades directory into the Unity assets directory should fix the issue. So I copied that DLL only to find that another DLL was required (System.Resources.ResourceManager). So I copied that one and repeated the process a bunch more until the build completed successfully. In the end I had to copy a total of 23 DLLs to get it to work!
What interests me is WHY I had to include some of the DLLS. Most of the required DLLs are part of mscorlib.dll and System.dll, which should already be included by Unity. For example, one of the DLLs I had to copy was System.Threading.Tasks. My Unity code (the code in my Unity Assets directory and not in a separate DLL) uses Tasks extensively, so that assembly must already by in the build.
If these assemblies can be referenced by Unity code without explicitly adding them to my Assets folder, why do I need to add them for the DLL? Won't this lead to multiple versions of these assemblies being compiled into my project? Is there something I can do so that I don't have to copy all 23 DLLs into my Assets folder?
More Info: ---------- Unity Version 2017.4.9f1 Scripting Runtime Version: Experimental .Net 4.6 Equivalent Scripting Backend: (IL2CPP on ios, .Net on PC and UWP) Api Compatibility Level: .Net 4.6
DLLs I had to include: ---------------------- - System.Collections - System.ComponentModel - System.ComponentModel.EventBasedAsync - System.Diagnostics.Debug - System.Diagnostics.Tools - System.Dynamics.Runtime - System.Globalization - System.IO - System.Linq - System.Ling.Queryable - System.Net.Requests - System.Reflect - System.Reflection - System.Reflection.Extensions - System.Resources.ResourceManager - System.Runtime.Extensions - System.Runtime.InteropServices - System.Runtime.Serialization.Primitives - System.Text.Encoding - System.Text.Encoding - System.Text.Encoding.Extensions - System.Text.RegularExpressions - System.Threading - System.Threading.Tasks - System.Xml.ReaderWriter

Viewing all articles
Browse latest Browse all 145

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>