System.IO.FileNotFoundException: Could not load file or assembly 'System.IO.Compression.FileSystem系统找不到指定的文件

错误:System.IO.FileNotFoundException: Could not load file or assembly 'System.IO.Compression.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. 系统找不到指定的文件。
File name: 'System.IO.Compression.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

 

 

分析:首先本地调用没问题,发布后放到服务器上就报,System.IO.Compression.FileSystem引用找不到了。

首先查看引用的版本,查看路径:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2

再检查你服务器上有没有此路径,发现没有.NETFramework\v4.5.2。

解决1(未成功):装.NETFramework 4.5.2,本人系统是 windows server 2018R2 企业版本 sp1,安装成功但是没找到。放弃。

解决2(成功):更换引用路径, C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.IO.Compression.FileSystem.dll  服务器上,和本地都有此路径,直接更换引用,成功解决。

posted @ 2022-07-11 14:56  羁绊lov  阅读(5855)  评论(0编辑  收藏  举报