Search Unity

Question System.Configuration.ConfigurationManager on IL2CPP is possible?

Discussion in 'Android' started by elfasito, Oct 14, 2021.

  1. elfasito

    elfasito

    Joined:
    Jul 4, 2017
    Posts:
    51
    Is possible make System.Configuration.ConfigurationManager works with IL2CPP scripting backend?.
    I have libraries what need it (EPPLUS), works well on mono, but on IL2CPP give me this errors:

    Code (CSharp):
    1. NotSupportedException: System.Configuration.ConfigurationManager::get_AppSettings
    2. System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <00000000000000000000000000000000>:0
    3. OfficeOpenXml.ExcelPackage.Init () [0x00000] in <00000000000000000000000000000000>:0
    4. OfficeOpenXml.ExcelPackage..ctor (System.IO.FileInfo newFile) [0x00000] in <00000000000000000000000000000000>:0
    5. WRITEXLSLIGHT.TaskWriteXLSX () [0x00000] in <00000000000000000000000000000000>:0
    6. UnityEngine.Events.UnityAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    7. UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0
    8. UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1].Invoke (T1 handler, UnityEngine.EventSystems.BaseEventData eventData) [0x00000] in <00000000000000000000000000000000>:0
    9. UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.E
    I tried a lot of libraries for create/write excel sheets on android but this is the only one what worked (partially)
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    No, IL2CPP does not support System.Configuration.ConfigurationManager, and we don't plan to add support for it soon, unforunately.
     
    elfasito likes this.
  3. KAJed

    KAJed

    Joined:
    Mar 15, 2013
    Posts:
    122
    What prevents this? Is it due to AOT issues? Is it possible to supply our own?
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    The managed code in the base class library to support System.Configuration.ConfigurationManager is very large - it brings a high code size cost. We felt that it was used so infrequently that it was not worth the code size tradeoff for all projects.

    You absolutely can supply your own code to read that configuration file if the trade-off makes sense for your project though.
     
  5. KAJed

    KAJed

    Joined:
    Mar 15, 2013
    Posts:
    122
    I had hoped I could simply bring in the JIT DLL and instruct unity to not strip any of it... alas that still exploded. It isn't world ending but it is certainly unfortunate to have this all supported in the Mono runtimes / Editor but not IL2CPP
     
  6. imjustthatguy1

    imjustthatguy1

    Joined:
    Apr 23, 2018
    Posts:
    27
    Then there must be a serious design flaw with either Il2CPP or the ConfigurationManager, especially when I hear that the team won't be working on it...its obviously a serious issue when its breaking the connection between Amazon's API's and the scripting backend of this engine, its funny to see where unitys priorities are in terms of issues, how can you expect any real developer to ship a product when they can't get to that point because of breaks like these?

    Whats worst than spending days mangling my code apart trying to understand why its breaking is being lied to by a company that their product actually works. I remember months ago watching Il2cpp tutorial videos and thinking "ok thats a cool feature of Unity, another reason to keep moving forward with this product" only to get to the actual point of utilizing it for it to come crashing in flames because of a Configuration Manager that probably sounds like it hasn't been refactored or decoupled in years. Just another reason to make the move to Unreal when I hear things like this, how can you not support Amazon API's?

    Serious, serious design issues. It is almost automatic to expect something like a scripting backend to work with something called a Configuration Manager.

    You might as well remove il2cpp altogether because its broken. What's worst than this is marketing it as something that works.

    These are exactly the type of issues you should be looking into. Your backend.
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    I'm sorry that you are experiencing a problem with these missing APIs. As with everything in engineering, we had to make a tradeoff, in this case between executable code size and feature support.

    We judged that ConfigurationManager was used in few enough games that it was a better decision not to support it. However, if these Amazon APIs that depend on it are becoming more prevalent, that might change our decision.

    For the time being, I want to be clear that we don't have any short-term plans to support ConfigurationManager with IL2CPP. But this is certainly something we will watch in the future, and we may add support for it.