Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by rickyroesler · Jan 09, 2019 at 06:48 PM · iosbuilddll.netassemblies

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

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by dsanteugini · Jan 11, 2019 at 10:45 AM

Hi @rickyroesler

I had the same issue in the past.

If you have a dll developed in pure c# (and later compiled to a dll) using other dll created in c# too, any library will work on your project. But, if you're trying to use a library that uses a non-c# dll (for example, a c++ library) it won't work. You will need to recompile all non-c# dll to a ios library (it creates a .so file) and these libraries needs to be static-linked. Otherwise, it won't works.

System.Diagnostics.Tools -> I'm pretty sure that this library uses a non-c# dll

Regards,

Dani

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

138 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

ios build error (UnityException: Failed assemblies stripper) 1 Answer

Using a .dll in Unity C# 1 Answer

Does a DLL work in an iOS build? 1 Answer

Keep assemblies in separated dll instead of GameAssembly.dll 0 Answers

Using a newer version of a library included in .net? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges