Search Unity

Bug Unity not finding DLL dependency of another DLL (both in Assets folder)

Discussion in 'Editor & General Support' started by auerfloriancom, Jun 26, 2020.

  1. auerfloriancom

    auerfloriancom

    Joined:
    Jan 17, 2019
    Posts:
    3
    Background info (might be relevant):

    • Using Unity 2019.4 with .Net Standard 2.0 compatibility
    • Writing code in Visual Studio 2019

    I have a Unity project that makes direct use of a third-party DLL ("library A"), which I've added to the project's Assets folder. Library A depends on another DLL, "library B", which I've also added to the Assets folder. Library B is not used by any scripts in the Unity project. Both libraries A and B are written in C# and target .NET Standard 2.0, i.e., they're both managed code.

    Once added to the Assets folder, both libraries A and B are listed under "References" when the project is opened in Visual Studio and "Copy Local" is set to "True" for both (although I don't know if Unity uses that property).

    However, when running the project in the Unity editor, various calls to library A raise exceptions that indicate that library B isn't available. The only way I've been able to get it to work is by placing a copy of library B in C:\Program Files\Unity_Editor\2019.4.1f1\Editor (the directory containing Unity.exe, the Unity editor executable).

    I've used libraries A and B in other, non-Unity projects and never had any issues (Visual Studio copies them both to the output directory as long as they're referenced). Am I missing a Unity-specific step that's necessary to tell it that library B is required?

    This topic was also raised by another person in Stackoverflow with slightly different config, but with no success, so I decided to raise it here.

    https://stackoverflow.com/questions...older?newreg=912b1cee96324bc58aac898005b88451