Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

DLL Issue

Discussion in 'Scripting' started by BigBGros, Sep 18, 2014.

  1. BigBGros

    BigBGros

    Joined:
    Aug 30, 2013
    Posts:
    21
    Hi all,

    I'm making a program that decompress and compress a file using 'Ionic.Zip.dll' the trick is that when I run in the editor, all works fine, but when i built it and run it... decompress and compress doesn't run... it seems that Ionic.Zip.dll is not referenced but is in the Data directory.

    Any one have similir issues before with dll's, how can be achieved?

    Thanks in advance.

    BigBGros
     
  2. kral

    kral

    Joined:
    Aug 7, 2011
    Posts:
    25
    can you try to change api compatibility level to .net 2.0 subset to .net 2.0. I have the same issue once and solved like this.

    Edit -> Project Settings -> Player -> Other Settings -> api compatibility level
     
  3. BigBGros

    BigBGros

    Joined:
    Aug 30, 2013
    Posts:
    21
    I already do it, but doesn't work.
     
  4. mirlix

    mirlix

    Joined:
    Jun 2, 2011
    Posts:
    7
    I also use this DLL and it works fine when you place it in the Plugins folder. This folder also should exist in your build, maybe check if the DLLs is placed in the correct folder in your build.
     
  5. BigBGros

    BigBGros

    Joined:
    Aug 30, 2013
    Posts:
    21
    I haven't this folder... so I've created and make the Build... the build now has plugins folder and inside is the DLL... but nothing changes.. is still not working in the build but it works in Editor playmode. I'm fustrated...
     
  6. mirlix

    mirlix

    Joined:
    Jun 2, 2011
    Posts:
    7
    Are there any errors in the log when you run the build that might help?
     
  7. BigBGros

    BigBGros

    Joined:
    Aug 30, 2013
    Posts:
    21
    No errors in log file:

    here it is:

    Initialize engine version: 4.3.2f1 (0517a5ae8669)
    GfxDevice: creating device client; threaded=1
    Direct3D:
    Version: Direct3D 9.0c [nvd3dum.dll 9.18.13.3523]
    Renderer: NVIDIA GeForce GT 520
    Vendor: NVIDIA
    VRAM: 977 MB (via DXGI)
    Caps: Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=0 INTZ=1 RAWZ=0 NULL=1 RESZ=0 SlowINTZ=0
    Begin MonoManager ReloadAssembly
    Platform assembly: G:\OSMLab_Data\Managed\UnityEngine.dll (this message is harmless)
    Loading G:\OSMLab_Data\Managed\UnityEngine.dll into Unity Child Domain
    Platform assembly: G:\OSMLab_Data\Managed\Assembly-CSharp.dll (this message is harmless)
    Loading G:\OSMLab_Data\Managed\Assembly-CSharp.dll into Unity Child Domain
    Platform assembly: G:\OSMLab_Data\Managed\Ionic.Zip.dll (this message is harmless)
    Loading G:\OSMLab_Data\Managed\Ionic.Zip.dll into Unity Child Domain
    - Completed reload, in 0.210 seconds
    desktop: 1680x1050 60Hz; virtual: 3360x1050 at -1680,0
    <RI> Initializing input.

    XInput1_3.dll not found.
    <RI> Input initialized.
     
  8. mirlix

    mirlix

    Joined:
    Jun 2, 2011
    Posts:
    7
    This seems ok.
    So how does it show that compression and decompression don't work? How are you using zlib in your code?
     
  9. BigBGros

    BigBGros

    Joined:
    Aug 30, 2013
    Posts:
    21
    The code:

    For extraction:

    Code (CSharp):
    1. ZipFile docx = new ZipFile(Application.persistentDataPath + "/docxtemp/" + filename);
    2.         docx.ExtractAll (temp_loc);
    3.         docx.Dispose ();

    For Compression:

    Code (CSharp):
    1. ZipFile zipdocx = new ZipFile ();
    2.         zipdocx.AddDirectory (temp_loc);
    3.         zipdocx.Save (Application.persistentDataPath + "/" + filename);
    As I said above, it runs ok on playmode in Editor
     
  10. mirlix

    mirlix

    Joined:
    Jun 2, 2011
    Posts:
    7
    And what happens in the build? Normally if something went wrong an exception would be thrown. Maybe try adding a try catch around the code and print the exception to the log. I don't think that Unity can't find the DLL, rather something else is wrong which doesn't print an error.
     
  11. BigBGros

    BigBGros

    Joined:
    Aug 30, 2013
    Posts:
    21
    it seems so... i'll try-catch to see something.

    Thanks anyway mirlix!!!