1.一般出现这个错误是因为Web.Config里面的版本号跟project用到的dll版本对应不上

更改webconfig

<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

或者直接把对应版本dll copy到web application folder 下面的bin



PublicKeyToken可以使用sn -T命令得知

使用vs的Tools Command Prompt命令行工具,输入SN -T "path",就会显示这个dll 的PublicKeyToken。

比如:C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC>SN -T "D:\documents\visual studio 2012\Projects\VirtualLabMVC\VirtualLabMVC\bin\DotNetOpenAuth.AspNet.dll"。



2.那如果发现Web.Config里面根本没有assembly的声明,只是引用了命名空间

<pages>

     <namespaces>

       <add namespace="System.Web.Helpers" />

       <add namespace="System.Web.Mvc" />

       <add namespace="System.Web.Mvc.Ajax" />

       <add namespace="System.Web.Mvc.Html" />

       <add namespace="System.Web.Optimization" />

       <add namespace="System.Web.Routing" />

       <add namespace="System.Web.WebPages" />

     </namespaces>

   </pages>

查找下该server有没有装MVC4

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.Mvc

如果没有,则安装





3.上面的都可以了,发现还不行,可能是另一個原因,將Specific Version改為false

could not load file or assembly "System.Web.Mvc...的更多相关文章

  1. Could not load file or assembly 'System.Web.Mvc, Version=5.2.3.0...

    一.在Mvc 发布时出现如下错误: Could not load file or assembly 'System.Web.Mvc, Version=5.2.3.0... 出现错误的原因是 Mvc版本 ...

  2. Could not load file or assembly 'System.Web.Mvc' or one of its dependencies. The located assembly's manifest definition does not

    因为用了MVC,在本地是没有问题的,但是部署在服务器就出现了这个问题. 出错界面如下图 原因分析:上面的出错提示最后一句话翻译过来.找到的程序集清单定义与程序集引用不匹配.也就是程序引用的程序集版本和 ...

  3. ASP.NET MV3 部署网站 报"Could not load file or assembly ' System.Web.Helpers “ 错的解决方法

    转自:http://www.cnblogs.com/taven/archive/2011/08/14/2138077.html 国内很多网站空间都只支持.NET 2.0 和 .NET 3.0 3.5, ...

  4. MVC4 部署 could not load file or assembly system.web.http.webhost 或是其它文件出误

    自从VS2010发布之后使用它来做开发的程序员越来越多,其中很多人使用了MVC来作为新的开发框架,但是在系统部署的时候我们也遇到诸多问题,因为目前大多数windows服务器采用的还是Windows S ...

  5. Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

    提示哪个引用修改哪个引用的属性: Could not load file or assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, ...

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

    今天写的是一个小程序,采用webfrom 形式,.netframework4.0 项目中调用了System.Web.Helpers下的Json方法. 在本地测试没问题,结果搭建到服务器上,死活运行不正 ...

  7. [Nuget] - "Runtime error: Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0'" 问题之解决

    环境 项目中使用了 System.Web.WebPages.Razor, Version=3.0.0.0,Nuget 还原缺失包后自动更新至 Version=3.2.5.0,编译成功,运行失败. 错误 ...

  8. Could not load file or assembly 'System.Web.Http

    使用FusLogVw https://stackoverflow.com/questions/4469929/could-not-load-file-or-assembly-or-one-of-its ...

  9. Could not load file or assembly Microsoft.Web.Infrastructure

    Error info:Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=n ...

随机推荐

  1. Kernel--试题

    1. 内核堆栈区别: 1.栈自动分配回收,函数里面声明的变量:2.堆:malloc kmalloc申请的空间,需要自己释放 https://blog.csdn.net/tainjau/article/ ...

  2. PostgreSQL练习

    学生表 Studentcreate table Student(Sid varchar(6), Sname varchar(10), Sage datetime, Ssex varchar(10)); ...

  3. cmake 升级

    cmake 升级 1下载   cmake-3.1.0.tar.gz2.解压 3.执行  ./configure 4.执行 make 5. 执行   sudo make install 6.添加环境变量 ...

  4. php实现算法

    二分法查找(已排序) @params  $arr 查找的数组  $start 开始查找的下标  $end 结束查找的下标  $value 查找的值 function bin_search($arr,$ ...

  5. python学习-6 猜拳小游戏

    import random # 调用随机数模块 pc = random.randint(1,3) # 产生1-3的随机数 print("来玩个猜拳游戏吧!") a = '石头' b ...

  6. 怎样获取当前网页的URL

    1. document.documentURI document.documentURI; // "https://i.cnblogs.com/EditPosts.aspx?opt=1&qu ...

  7. eventFlow 系列 <一> 入门

    var exampleId = ExampleId.New; var commandBus = resolver.Resolve<ICommandBus>(); ,) var execut ...

  8. DNSMASQ 部分选项 设置

    --local-service 仅接受地址位于本地子网上的主机(即服务器上存在接口的子网)的DNS查询.仅当没有--interface,-- except-interface,--listen-add ...

  9. input checkbod 全选 反选

      <script>             var CheckBox=div.getElementsByTagName('input');                         ...

  10. TF_Variable Sharing

    Reference: http://jermmy.xyz/2017/08/25/2017-8-25-learn-tensorflow-shared-variables/ Tensorflow does ...