Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load type 'System.IO.Compression.ZipFile' from assembly on docker raspberry pi #34117

Open
mwkldeveloper opened this issue Mar 26, 2020 · 0 comments

Comments

@mwkldeveloper
Copy link

mwkldeveloper commented Mar 26, 2020

core 3.1.3
Below code can be run on window
But not with docker on raspberry, throw err:
Update: I found that build Debug do not have this error, only occur when build Release

TypeLoadException: Could not load type 'System.IO.Compression.ZipFile' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

[HttpGet("logs")]
     public ActionResult GetLog()
     {
         string startPath = @"./data/logs";
         string zipPath = @"./tmp/logs.zip";
         try
         {
             ZipFile.CreateFromDirectory(startPath, zipPath);
             var data = System.IO.File.ReadAllBytes(zipPath);
             var content = new System.IO.MemoryStream(data);
             const string contentType = "application/zip";
             var fileName = $"logs-{DateTime.Now.ToString("yyyyMMddhhmmss")}.zip";
             return File(content, contentType, fileName);
         }
         finally
         {
             System.IO.File.Delete(zipPath);
         }
     }
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.IO.Compression untriaged New issue has not been triaged by the area owner labels Mar 26, 2020
@carlossanlop carlossanlop added this to the Future milestone Jun 29, 2020
@carlossanlop carlossanlop removed the untriaged New issue has not been triaged by the area owner label Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants