Search Unity

Build Issue -- Not finding base .NET libraries

Discussion in 'Editor & General Support' started by psyclone, Oct 6, 2010.

  1. psyclone

    psyclone

    Joined:
    Nov 17, 2009
    Posts:
    245
    Getting these error when trying to compile a scene using a .NET dll (from Badumna)

    Error building Player: Extracting referenced dlls failed.
    UnityEditor.HostView:OnGUI()

    --

    ArgumentException: The Assembly System.Web is referenced by log4net. But the dll is not allowed to be included or could not be found.
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at E:/BuildAgent/work/68355d6e5d19d587/Editor/Mono/AssemblyHelper.cs:52)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at E:/BuildAgent/work/68355d6e5d19d587/Editor/Mono/AssemblyHelper.cs:55)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2 cache) (at E:/BuildAgent/work/68355d6e5d19d587/Editor/Mono/AssemblyHelper.cs:55)
    UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch) (at E:/BuildAgent/work/68355d6e5d19d587/Editor/Mono/AssemblyHelper.cs:86)
    UnityEditor.HostView:OnGUI()


    Where does unity look for these .NET libraries? The scene runs correctly from within the Editor

    Thanks

    Jason
     
  2. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Any and all libraries that are .Net that you want to have with your project that Unity doesn't know about, simply place them in your Assets folder somewhere on some level, maybe Resources, however, that doesn't mean it will be allowed to be used even if it does exist, especially for the web player.
     
  3. psyclone

    psyclone

    Joined:
    Nov 17, 2009
    Posts:
    245
    Thanks for the quick response Zumwalt. I will certainly do so... Although that seems less than optimal, given that these are standard library.

    And no, Im working in the Standalone world as present for these tests....
     
  4. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    System.Data is a standard library but Unity doesn't know what it is, so if you add Using System.Data; it will have no clue what you are on about, same goes for Mono libraries and quiet a few others, so you simply have to drag the appropriate library to some folder in your assets folder and this is resolved. Although do not expect that to mean it will work in any build, just some builds.
     
  5. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    I always found this quite odd because if you compile your code into a dll, and include your dll you do not need to include the other dll's (which yours depends on) as well.
     
  6. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Because your DLL build has the assembly reference embedded in the build, that reference points to the framework assembly so that means by proxy the assembly is located through your DLL.
     
  7. rookboom

    rookboom

    Joined:
    Sep 17, 2010
    Posts:
    3
    Try to find a version of log4net.dll that does not have a dependency on System.Web.
    You can download the sourcecode and build the .Net Compact version.
     
  8. Ziplock9000

    Ziplock9000

    Joined:
    Jan 26, 2016
    Posts:
    360
    Any solution to this... The mono 2.0 version of log4net has this issue where it needs System.Web.
    Later versions for mono or .NET dont work at all due to reflection issues