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

问题描述

错误:结果
    未能加载文件或程序集 System.Web.Mvc 版本= 5.2.3.0 文化=中性 公钥= 31bf3856ad364e35 或它的一个依赖。该系统的找不到指定文件

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

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

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value     [HKLM\Software\Microsoft\Fusion!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   [HKLM\Software\Microsoft\Fusion!EnableLog].

我的的web.config

<configuration>
<connectionStrings>
<add name="AbbasMVCContext" connectionString="Data Source=DESKTOP- 584JRQR\ASUSSQLSERVER;Initial Catalog=AbbasMVCDB;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Forms">
<forms loginUrl="~/Authentication/Login"></forms>
</authentication>
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
</compilers>
</system.codedom>
</configuration>

我的滨地址 首页/ mywebsite.com / wwwroot文件/ bin中在主机提供商和bin文件夹中:

my bin-address: Home/mywebsite.com/wwwroot/bin on the host provider and inside bin folder:

roslyn  Rename File/Folder  Edit Permissions
Abbas MVC.dll  Rename File/Folder  Edit Permissions
Antlr3.Runtime.dll  Rename File/Folder  Edit Permissions
BusinessEntities.dll  Rename File/Folder  Edit Permissions
BusinessLayer.dll  Rename File/Folder  Edit Permissions
DataAccessLayer.dll  Rename File/Folder  Edit Permissions
EntityFramework.dll  Rename File/Folder  Edit Permissions
EntityFramework.SqlServer.dll  Rename File/Folder  Edit Permissions          Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll  Rename File/Folder  Edit Permissions.
Microsoft.Web.Infrastructure.dll  Rename File/Folder  Edit Permissions        Newtonsoft.Json.dll  Rename File/Folder  Edit Permissions
System.Data.DataSetExtensions.dll  Rename File/Folder  Edit Permissions
System.Net.Http.Formatting.dll  Rename File/Folder  Edit Permissions
System.Web.Extensions.dll  Rename File/Folder  Edit Permissions
System.Web.Helpers.dll  Rename File/Folder  Edit Permissions
System.Web.Http.dll  Rename File/Folder  Edit Permissions
System.Web.Http.WebHost.dll  Rename File/Folder  Edit Permissions
System.Web.Mvc.dll  Rename File/Folder  Edit Permissions
System.Web.Optimization.dll  Rename File/Folder  Edit Permissions
System.Web.Razor.dll  Rename File/Folder  Edit Permissions
System.Web.WebPages.Deployment.dll  Rename File/Folder  Edit Permissions
System.Web.WebPages.dll  Rename File/Folder  Edit Permissions
System.Web.WebPages.Razor.dll  Rename File/Folder  Edit Permissions
ViewModel.dll  Rename File/Folder  Edit Permissions
WebGrease.dll  Rename File/Folder  Edit Permissions

为什么它不工作。

why its not working.

推荐答案

这必须是默认的控制器和动作名称来改变我们的价值观的名字。结果
在App_start-> RouteConfig.cs

This must be the name of the default controller and action name to change our values.
in the App_start->RouteConfig.cs

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Controller name", action = "Action name", id =      UrlParameter.Optional }
);

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

08-21 07:20