Search Unity

The problem about package dependency and dlls

Discussion in 'Package Manager' started by watsonsong, May 16, 2019.

  1. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    I have some code compile into dll using the AssemblyBuilder。And the dll is reference the TextMeshPro
    I write the package.json and specify the dependence about the text mesh pro, but when I use this package, it always tips:
    `Unable to resolve reference 'Unity.TextMeshPro'. Is the assembly missing or incompatible with the current platform?`

    I write this into the package.json
    "dependencies": {
    "com.unity.textmeshpro": "1.4.0"
    },

    And the first time the dll loaded, it always has a lot of error report:
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
    at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00105] in <a3989f8c34e6476eaca56644d5639ee8>:0
     
    Last edited: May 16, 2019
  2. mathieur

    mathieur

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    31
    That's strange. It seems like its working for me. What editor version are you using? I'v attached a project that seems to replicate what you want to do. Is it possible you didn't add the necessary reference to Text Mesh Pro assemblies when using the AssemblyBuilder?
     

    Attached Files:

  3. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051