none
Could not load file or assembly

    Question

  • My application is working fine on my co-workers machine. It is having issues on my machine only. The issue is DotNetzipLib and iCSharpZipLib.

    #1

    System.IO.FileLoadException was caught
      Message=Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=0.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. Access is denied.
      Source=Project.Helpers
      FileName=ICSharpCode.SharpZipLib, Version=0.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73
      FusionLog==== Pre-bind state information ===
    LOG: User = Unknown
    LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73
     (Fully-specified)
    LOG: Appbase = file:///C:/Users/UserPC/Documents/DATA/Projects/ProjectHelperApps/ProjectHelper/TestResults/UserPC_UserPCJ-LAPTOP 2012-08-03 15_50_57/Out
    LOG: Initial PrivatePath = NULL
    Calling assembly : Project.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Users\UserPC\Documents\DATA\Projects\ProjectHelperApps\ProjectHelper\TestResults\UserPC_UserPCJ-LAPTOP 2012-08-03 15_50_57\Out\Project.Helpers.Tests.DLL.config
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: ICSharpCode.SharpZipLib, Version=0.85.3.365, Culture=neutral, PublicKeyToken=1b03e6acf1164f73
    LOG: Attempting download of new URL file:///C:/Users/UserPC/Documents/DATA/Projects/ProjectHelperApps/ProjectHelper/TestResults/UserPC_UserPCJ-LAPTOP 2012-08-03 15_50_57/Out/ICSharpCode.SharpZipLib.DLL.
    ERR: A fatal error occurred when retrieving next codebase for download (hr = 0x80070005).
    
      StackTrace:
           at Project.Helpers.IO.ZipUtility.ZipFiles(String toArchivePath, String destDir, String archiveName, String password, Boolean isDir)
           at Project.Helpers.IO.FileSystem.ArchiveDirectory(String dirToArchive, String destDir, String archiveName)
      InnerException:

    #2:

    Could not load file or assembly 'Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c' or one of its dependencies. Access is denied.

    How can i find and fix these issues?

    Saturday, August 04, 2012 8:10 AM

Answers

  • You have file access permission errors. You should ensure that you can read and execute all the dll refered in your solution. Both DotNetzipLib and iCSharpZipLib can be downloaded from intered and added to your solution:

    http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx

    http://dotnetzip.codeplex.com/

    Simpler solution is to explore your solution and to look in your project references to DotNetZip and iCShartZipLib where these dll are located and ensure that you have read access to them, for example copying the files to your My Documents folders from their original location.

    • Marked as answer by Learning123 Tuesday, August 07, 2012 5:25 AM
    Saturday, August 04, 2012 2:53 PM
  • You have file access permission errors. You should ensure that you can read and execute all the dll refered in your solution. Both DotNetzipLib and iCSharpZipLib can be downloaded from intered and added to your solution:

    http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx

    http://dotnetzip.codeplex.com/

    Simpler solution is to explore your solution and to look in your project references to DotNetZip and iCShartZipLib where these dll are located and ensure that you have read access to them, for example copying the files to your My Documents folders from their original location.

    This is what worked for me:

    1. Gave ownership of C to admin group and drilled it down to the file level instead of the installer.

    2. Applied full control permission on C for admin group and drilled it down to the file level

    Tuesday, August 07, 2012 5:26 AM

All replies

  • How can i find and fix these issues?

    To find and fix issues related to the loading of assemblies, you can use the Fusion Log Viewer (FUSLOGVW.EXE).

    You can launch FUSLOGVW from a Visual Studio Command Prompt. Make sure to use "Run as Administrator", otherwise most options in the fuslogvw application will be grayed-out.

    Once fuslogvw is open, click on Settings and enable the Log. Then run your application until it fails, and come back to fuslogvw to view the fusion log. It should list all the assemblies that your application attempted to load, the versions that it sought, and the places where it looked for them. This should give you a good clue about what the issues are and how to fix them.

    Saturday, August 04, 2012 9:11 AM
  • You have file access permission errors. You should ensure that you can read and execute all the dll refered in your solution. Both DotNetzipLib and iCSharpZipLib can be downloaded from intered and added to your solution:

    http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx

    http://dotnetzip.codeplex.com/

    Simpler solution is to explore your solution and to look in your project references to DotNetZip and iCShartZipLib where these dll are located and ensure that you have read access to them, for example copying the files to your My Documents folders from their original location.

    • Marked as answer by Learning123 Tuesday, August 07, 2012 5:25 AM
    Saturday, August 04, 2012 2:53 PM
  • How can i find and fix these issues?

    To find and fix issues related to the loading of assemblies, you can use the Fusion Log Viewer (FUSLOGVW.EXE).

    You can launch FUSLOGVW from a Visual Studio Command Prompt. Make sure to use "Run as Administrator", otherwise most options in the fuslogvw application will be grayed-out.

    Once fuslogvw is open, click on Settings and enable the Log. Then run your application until it fails, and come back to fuslogvw to view the fusion log. It should list all the assemblies that your application attempted to load, the versions that it sought, and the places where it looked for them. This should give you a good clue about what the issues are and how to fix them.

    I have tried it, in the list i don't see any entries for either of the 2 dlls. When looking into others, after the first click it crashes. I have to clear temp files, run again and then look at another entry. Finally gave up on it. 

    Saturday, August 04, 2012 9:26 PM
  • You have file access permission errors. You should ensure that you can read and execute all the dll refered in your solution. Both DotNetzipLib and iCSharpZipLib can be downloaded from intered and added to your solution:

    http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx

    http://dotnetzip.codeplex.com/

    Simpler solution is to explore your solution and to look in your project references to DotNetZip and iCShartZipLib where these dll are located and ensure that you have read access to them, for example copying the files to your My Documents folders from their original location.

    I always create an assets folder inside my solution and then reference the dlls from there. I have looked into security and all 3 accounts on this machine have full control.

    My solution path:

    C:\Users\developerx\Documents\DATA\Projects\HelperApps\FileHelper

    C:\Users\developerx\Documents\DATA\Projects\HelperApps\FileHelper\Assets\ZipLibrary

    • Edited by Learning123 Saturday, August 04, 2012 9:51 PM
    Saturday, August 04, 2012 9:38 PM
  • You have file access permission errors. You should ensure that you can read and execute all the dll refered in your solution. Both DotNetzipLib and iCSharpZipLib can be downloaded from intered and added to your solution:

    http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx

    http://dotnetzip.codeplex.com/

    Simpler solution is to explore your solution and to look in your project references to DotNetZip and iCShartZipLib where these dll are located and ensure that you have read access to them, for example copying the files to your My Documents folders from their original location.


    I have worked with my system admin and fixed the permissions but still no luck.
    Monday, August 06, 2012 8:14 PM
  • You have file access permission errors. You should ensure that you can read and execute all the dll refered in your solution. Both DotNetzipLib and iCSharpZipLib can be downloaded from intered and added to your solution:

    http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx

    http://dotnetzip.codeplex.com/

    Simpler solution is to explore your solution and to look in your project references to DotNetZip and iCShartZipLib where these dll are located and ensure that you have read access to them, for example copying the files to your My Documents folders from their original location.

    This is what worked for me:

    1. Gave ownership of C to admin group and drilled it down to the file level instead of the installer.

    2. Applied full control permission on C for admin group and drilled it down to the file level

    Tuesday, August 07, 2012 5:26 AM
  • Hi Learning,

    Thank you sharing your solution here. It will be benefit with the other community members.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, August 09, 2012 12:57 AM
    Moderator