无法加载文件或程序集“System.Web.Mvc" [英] Could not load file or assembly 'System.Web.Mvc'

查看:33
本文介绍了无法加载文件或程序集“System.Web.Mvc"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的新 ASP.NET MVC Web 应用程序可以在我的开发工作站上运行,但不能在我的 Web 服务器上运行...

<小时>

/"应用程序中的服务器错误.

<小时>

配置错误

说明:在处理为该请求提供服务所需的配置文件期间发生错误.请查看下面的特定错误详细信息并适当修改您的配置文件.

解析器错误消息: 无法加载文件或程序集System.Web.Mvc,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35"或其依赖项之一.该系统找不到指定的文件.

源错误:

第 44 行:<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>第 45 行:<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>第 46 行:<add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>第 47 行:<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>第 48 行:<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

源文件: C:inetpubwww.example.orgweb.config 行: 46

程序集加载跟踪:以下信息有助于确定无法加载程序集System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"的原因.

<前>警告:程序集绑定日志已关闭.要启用程序集绑定失败日志记录,请将注册表值 [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) 设置为 1.注意:有一些与程序集绑定失败日志相关的性能损失.要关闭此功能,请删除注册表值 [HKLMSoftwareMicrosoftFusion!EnableLog].

<小时>

版本信息: Microsoft .NET Framework 版本:2.0.50727.3053;ASP.NET 版本:2.0.50727.3053

<小时>

我需要在服务器上安装 AspNetMVCBeta-setup.msi 吗?或者是否有不同的服务器安装程序?

解决方案

我刚刚写了一篇博客文章来解决这个问题.你可以在你的服务器上安装 ASP.NET MVC 或者你可以按照 步骤在这里.

<小时>

(由 jcolebrand 提供)我浏览了此链接,然后遇到了与 相同的问题维克多 下面,所以我建议你也添加这些:

* Microsoft.Web.Infrastructure* System.Web.Razor* System.Web.WebPages.Deployment* System.Web.WebPages.Razor

My new ASP.NET MVC Web Application works on my development workstation, but does not run on my web server...


Server Error in '/' Application.


Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 44:         <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 45:         <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 46:         <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 47:         <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Line 48:         <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

Source File: C:inetpubwww.example.orgweb.config Line: 46

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053


Do I need to install the AspNetMVCBeta-setup.msi on the server? Or is there a different installer for servers?

解决方案

I just wrote a blog post addressing this. You could install ASP.NET MVC on your server OR you can follow the steps here.


EDIT: (by jcolebrand) I went through this link, then had the same issue as Victor below, so I suggest you also add these:

* Microsoft.Web.Infrastructure
* System.Web.Razor
* System.Web.WebPages.Deployment
* System.Web.WebPages.Razor

这篇关于无法加载文件或程序集“System.Web.Mvc"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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