Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Modifying Tiny's mscorlib.cs issues

Discussion in 'Project Tiny' started by tomy93, Dec 20, 2019.

  1. tomy93

    tomy93

    Joined:
    May 31, 2017
    Posts:
    3
    I'm trying to modify Tiny's mscrolib.cs (located in
    \Library\DotsRuntimeBuild\artifacts\Stevedore\il2cpp\mscorlib
    ) in Tiny 0.16.1-preview.

    Though, I have a couple of weird results:
    - My changes are not being reflected when trying a build (Nullreference or Could not load errors).
    - At the output build folder, the mscorlib.dll does indeed reflect my changes (I took a look with dotPeek Decompiler).
    - If I delete the mscorlib.dll from the build folder, the build console doesn't shows any error related to that dll missimg.

    So, what's going on? It's possible to modify Tiny's mscorlib? I need to this because there is a
    error CS0656: Missing compiler required member 'System.String.Concat'
    error that prevent's building when trying to concat some strings.
     
  2. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    230
    0.16 is no longer supported; please upgrade to 0.20 first. We still use a tiny mscorlib in 0.20, so you might still need to do this, but it has changed some, and moreover the build process for it has changed as well.
     
  3. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    @elliotc-unity Thansk for your reply. Would you mind letting us know the best way to determine what's in the 0.20 tiny mscorlib, and how to make changes to that (if necessary)? I see a lot of `mscorlib.dll` files in the `ProjectTinySamples/Tiny3D` library folder after making a build.
     
  4. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    230
    You could look at it in ILSpy, but that's one of the things that's going to be hard to modify at the moment. The one that's in the final build directory (Builds/YourBuildSettingsName) is the one used at runtime.
     
  5. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    Thanks. I'm also curious about modifying it for wasm and asm.js builds, though -- would you mind letting us know which is the one that gets passed into the emscripten linker, and where in the build process code that's controlled?
     
  6. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    230
    Should be in
    Library/DotsRuntimeBuild/artifacts/NameOfYourBuildSettingsAsset/post_typereg
    , but I'm not sure that will do it for you, because I think the C# compiler reacts to it being missing at compile time (much earlier) and generates code you don't like. So you might have better luck modifying the one we ship, which is in
    Library/DotsRuntimeBuild/artifacts/Stevedore/il2cpp/build/profiles/Tiny
    , and then leaving the build hookup alone.

    In general, the build stuff controlling this latter location is in
    com.unity.dots.runtime\bee~\BuildProgramSources\Il2Cpp.bee.cs
    , specifically the
    _tinyCorlib
    field. As you can see, though, we ALSO ship our own version of netstandard.dll, and compile against that, which you will also have to modify, so it's gonna get real tricky. I would really think you would have a better time just creating strings in a way that compiles with the existing situation.
     
  7. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    You're probably right, but I'm glad that we know where to look in case we run into trouble. Thanks a lot for taking the time!