asp.net-mvc – Asp.net mvc 4部署错误
我已经在mvc 4中开发了一个Web应用程序.在开发机器上一切都很好,但是在实时服务器上它给了我以下错误.
无法加载文件或程序集
我尝试了以下解决方案: >将dll文件从本地驱动器复制到bin文件夹 这是确切的屏幕跟踪.请注意,最后一行显示.net版本4以及asp.net版本4所以我认为它不是问题.请指导我. Could not load file or assembly 'System.Web.Http,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.BadImageFormatException: Could not load file or assembly 'System.Web.Http,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Http,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]. Stack Trace: [BadImageFormatException: Could not load file or assembly 'System.Web.Http,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest.] innovationtimes.MvcApplication.Application_Start() +0 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 这是整个web.config文件 <?xml version="1.0"?> <!-- For more information on how to configure your ASP.NET application,please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <appSettings> <add key="webpages:Version" value="2.0.0.0"/> <add key="webpages:Enabled" value="false"/> <add key="PreserveLoginUrl" value="true"/> <add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/> </appSettings> <connectionStrings> <!--<add name="DataContext" providerName="System.Data.SqlClient" connectionString="Data Source=pc1SQLEXPRESS;Initial Catalog=itdb;User Id=sa;Password=12345;"/>--> </connectionStrings> <system.web> <customErrors mode="Off"></customErrors> <compilation debug="true" targetFramework="4.0"/> <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.Routing"/> <add namespace="System.Web.WebPages"/> </namespaces> </pages> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules runAllManagedModulesForAllRequests="true"/> <handlers> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/> <remove name="ExtensionlessUrlHandler-Integrated-4.0"/> <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%Microsoft.NETFrameworkv4.0.30319aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/> <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%Microsoft.NETFramework64v4.0.30319aspnet_isapi.dll" preCondition="classicMode,bitness64" responseBufferLimit="0"/> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/> </handlers> </system.webServer> </configuration> 解决方法
我终于成功完成了它.希望它也能帮助那些有类似问题的人.
罪魁祸首是发布向导.我使用发布工具发布了我的项目.但是,当我上传已发布的项目时,它根本无法正常工作并显示system.web.http程序集已损坏. 我是怎么解决的 – 我从我项目的bin文件夹上传了system.web.http dll来覆盖发布向导的dll. 我被进一步提示进入其他dll,我为所有这些做了同样的事情. 一旦我用bin文件夹中的一个替换了所有错误的dll,应用程序就开始工作了. 我不确定它是否是Visual Studio发布向导的错误.如果有人对这个问题有更好的了解,请在这里发帖寻求他人的帮助. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net-mvc-3 – IIS7中的NLog在发布模式下失败
- [你必须知道的.NET] 第三回:历史纠葛:特性和属性
- asp.net-mvc-4 – 在razor中获取当前用户名
- 当使用ASP.Net Membership和另外一个表来存储用户信息时,我
- asp.net-mvc – HttpContext中需要什么来允许FormsAuthenti
- asp.net-mvc – 未找到路径’/ Home’的控制器或未实现ICon
- asp.net – 这是什么错误?
- asp.net-mvc-2 – 检测到一个有潜在危险的request.form值,但
- 如何指导获取一个经典的asp应用程序在IIS 7.0下工作
- ASP.net MVC4:在局部视图中使用不同的模型?
- asp.net – 无法打开登录请求的数据库.登录失败.
- asp.net fileupload控件上传文件与多文件上传
- asp.net-mvc-3 – 检查.NET MVC中的AngularJS $资
- asp.net – 以编程方式将几个地址添加到谷歌地图
- asp.net-mvc – 改进ASP.NET MVC启动性能
- asp.net-mvc – 强制剃刀不逃避网址
- asp.net – MSDeploy连接字符串的自动加密,字典中
- asp.net-mvc – 为Razor调整自定义Html助手(它使
- asp.net-mvc – 有一个强大的方法来删除ASP.NET
- asp.net-mvc – mvc默认期限后的会话超时(20分钟