ex:Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, . 系统找不到指定的文件。

今天写的是一个小程序,采用webfrom 形式,.netframework4.0

项目中调用了System.Web.Helpers下的Json方法。

在本地测试没问题,结果搭建到服务器上,死活运行不正常。

报错: 

ex:Could not load file or assembly 'System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 系统找不到指定的文件。

折腾了好久,知道解决方法:

第1种 、在项目里引用 System.Web.Helpers,将属性设为“复制本地”,发布之后得到System.Web.Helpers.dll,拷贝到生产服务器对应的BIN目录,问题解决。

第2种、直接把System.Web.Helpers.dll 文件拷贝到bin目录下就可以了。

原文地址:https://www.cnblogs.com/puzi0315/p/4575301.html