Windows 更新导致 MVC3 和 MVC4 停止工作 [英] Windows update caused MVC3 and MVC4 stop working

查看:24
本文介绍了Windows 更新导致 MVC3 和 MVC4 停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是唯一一个在 10 月 15 日安装了 Windows 更新 (8.1) 的人,但由于这个警告,MVC 突然停止工作了吗?

<块引用>

警告 1 无法解析此引用.无法找到程序集System.Web.Mvc,版本=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL".检查以确保该程序集存在于磁盘上.如果您的代码需要此引用,您可能会遇到编译错误.

似乎此 Windows 更新安装了版本号为 4.0.0.1 的较新版本的 MVC,并从程序文件夹中删除了旧版本.

有人知道如何在不抓取每个项目的情况下解决这个问题吗?

解决方案

最好的解决方案是将 DLL 更新到 4.0.0.1 版.尝试使用 nuget:

Install-Package Microsoft.AspNet.Mvc -Version 4.0.40804 -Project <您的项目名称>

这会自动更新

<块引用>

 <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/><bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1"/></dependentAssembly>

您只需在以下位置手动编辑 System.Web.Mvc 版本:

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

am i the only one who installed a Windows Update (8.1) on october 15, and suddenly MVC stop working because of this warning?

Warning 1 Could not resolve this reference. Could not locate the assembly "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

It seems that this windows update installs a newer version of MVC with version number 4.0.0.1, and removes old version from program files folder.

Someone know how to fix this without crawling for each project?

解决方案

The best solution is update DLL to version 4.0.0.1. Try use nuget:

Install-Package Microsoft.AspNet.Mvc -Version 4.0.40804 -Project <your project name>

This will automatically update

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
  </dependentAssembly>

You just have to edit version System.Web.Mvc manually in:

<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

这篇关于Windows 更新导致 MVC3 和 MVC4 停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆