Search Unity

Unity.Collections exception

Discussion in 'Data Oriented Technology Stack' started by wobes, Dec 12, 2018.

  1. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    669
    Good day.

    Is there any way to resolve an issue with the dublication of System.Runtime.CompilerServices.Unsafe.dll
    I wish to use another version of it but I can't because it conflicts with the built in version in Unity.Collections package. When I drop another version of 4.5.0 unsafe library it throws the exception. I have another library that has dependency on the 4.5.0 unsafe library not the Unity.Collections one. So there should be a feature to remove the library that in the the package.

    Library\PackageCache\com.unity.collections@0.0.9-preview.10\Unity.Collections\UnsafeUtilityEx.cs(13,24): error CS0433: The type 'Unsafe' exists in both 'System.Runtime.CompilerServices.Unsafe, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'



    Thank you.
     
    Last edited: Dec 12, 2018
  2. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    669
  3. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    669
    Temporary fixed by deleting the dll from the Library/PackageCache folder.
     
  4. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,265
    Try using Override References button on your .asmdef and manually choose the right .dll for your assembly
     
  5. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    669
    I don't have any .asmdef in my project. And adding one and setting to override doesn't work too.
     
  6. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,666
    What happens if you turn off auto including on the .dll? and auto referencing? [After also including it in the override of the asmdef]
     
    wobes likes this.
  7. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    669
    Have multiple errors and everything is broken.
     
  8. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    669
  9. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    1,666
    I already did and it worked fine - got rid of the error. Hence my suggestion.

    However I did not have any libraries referencing it or attempt a build so I couldn't confirm it'd work.
     
  10. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    669
    Solved by disabling auto reference, auto including and creating an asmdef file with overriding a new dll.
    However still requires old .dll to be removed in order to properly create asmdef.