我将MVC 3更新为MVC 4,从那时起,当我尝试在iis服务器x1c 0d1x上上传新版本时,我遇到了很多问题
例如,如果我将web.config中对dll的引用更改为以前的引用,例如将System.Web.Helpers从2.0.0.01.0.0.0,我将在“/”应用程序中得到服务器错误。如果我查看事件查看器,我可以看到问题是无法加载文件或程序集。PublicKeyToken= 31 bf 3856 ad 364 e35 '或它的一个依赖项.这是正确的.但当我修复它的时候,我得到404,我完全不明白为什么.我正在寻找的资源已被删除,有其名称没有更改,并且是可用的.
这是我web.config
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="EasyCard.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>AQAAANT1OEUHcgVx7wrYZXhCjSKB9RRz8ouQvSmWwnB3pW/JeEJQ0DDkL3BtUdxkAAAAAJftXTnsZMcS59nUna7Ft55reLlyuHVy+WAQUF4ZEotg1pJT84MUPsmXbDg+2Z1L+Ene/W8kHzEV5O6omJLR2d</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="AutoEncyptConfig" value="True" />
<add key="EnsureBackDaysCountToView" value="30" />
</appSettings>
<enterpriseLibrary.ConfigurationSource selectedSource="System Configuration Source">
<sources>
<add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="File-based Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" filePath="C:\EasyCard\Web\PublicWeb\entlib.config" />
</sources>
<redirectSections>
<add sourceName="File-based Configuration Source" name="loggingConfiguration" />
</redirectSections>
</enterpriseLibrary.ConfigurationSource>
<system.web>
<sessionState timeout="15" />
<globalization uiCulture="he-IL" culture="he-IL" />
<customErrors mode="On" defaultRedirect="~/Errors">
<error statusCode="404" redirect="~/Errors/E404" />
</customErrors>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
</httpHandlers>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
</compilation>
<roleManager enabled="true" defaultProvider="BasicRoleProvider">
<providers>
<add name="BasicRoleProvider" type="EasyCard.Membership.BasicRoleProvider" />
</providers>
</roleManager>
<authentication mode="Forms">
<forms loginUrl="~/Accounts/Login" timeout="15" requireSSL="true" slidingExpiration="true" defaultUrl="~/" protection="All" cookieless="UseCookies" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
<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>
<httpRuntime shutdownTimeout="108000" requestPathInvalidCharacters="" encoderType="Common.AntiXssEncoder, Common" targetFramework="4.6" />
<machineKey decryptionKey="A3CC7D1756C4EB8CC4D2DFA7A3A202475F6ABAC8D0D08411" validationKey="8CB42DE40D168E41DA9FE8AF798446ED8951D0719CF241F5311946B708E7BFE2F98C72B73B55C66E011EF8CA57457637B74B42409500133A4E41E587ECEAB465" />
</system.web>
<location path="BillingSystem/CreateCustomerFormRequest">
<system.web>
<authorization>
<allow users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Home/CalculateUpayCommission">
<system.web>
<authorization>
<allow users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Home/GetUpayCommissionsTable">
<system.web>
<authorization>
<allow users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="BillingForm/RedirectWithShovar">
<system.web>
<authorization>
<allow users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="BillingSystem/CreateCustomerForm">
<system.web>
<authorization>
<allow users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Content">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Scripts">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Accounts/PreLoginChange">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="easycard/cardexp.asp">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="easycard/cardexpurl.asp">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="BillingForm/FillForm">
<system.web>
<authorization>
<allow users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</runtime>
<applicationSettings>
<EasyCard.Properties.Settings>
<setting name="EasyCard_Shva_ABSRequest" serializeAs="String">
<value>https://www.shva-online.co.il/ash/abscheck/absrequest.asmx</value>
</setting>
</EasyCard.Properties.Settings>
</applicationSettings>
<system.net>
<mailSettings>
<smtp>
<network host="10.0.0.20" port="25" />
</smtp>
</mailSettings>
</system.net>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SendMessageSoap" />
<binding name="CurrencyConvertorSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<customBinding>
<binding name="CurrencyConvertorSoap12">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous" bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard" keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous" realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://www.webservicex.net/CurrencyConvertor.asmx" binding="basicHttpBinding" bindingConfiguration="CurrencyConvertorSoap" contract="CurrencyServiceReference.CurrencyConvertorSoap" name="CurrencyConvertorSoap" />
<endpoint address="http://www.webservicex.net/CurrencyConvertor.asmx" binding="customBinding" bindingConfiguration="CurrencyConvertorSoap12" contract="CurrencyServiceReference.CurrencyConvertorSoap" name="CurrencyConvertorSoap12" />
<endpoint address="http://api.inforu.co.il/SendMessage.asmx" binding="basicHttpBinding" bindingConfiguration="SendMessageSoap" contract="InforUMobileService.SendMessageSoap" name="SendMessageSoap" />
</client>
</system.serviceModel>
</configuration>
当我尝试将web.config中的MVC 4 dll版本更改为以前版本的MVC 3时,我得到了一个关于它的错误,即它找不到版本为x的程序集,并且它是正确的。当我修复它时,我希望成功运行,但最终我得到404未找到
2条答案
按热度按时间ybzsozfc1#
出现此错误的原因有很多,可以尝试以下方法解决问题:
1.尝试删除所有绑定重定向:
bindingRedirect oldVersion="" newVersion="" />
1.将.NET CLR版本更改为v4.0。
1.如果仍然不起作用,请确保当前项目的依赖项的版本正确。
lg40wkob2#
实际上,经过这么多个小时的调查,我找到了解决方案。我不得不从项目文件夹中删除PrecompiledApp文件。