Home > other >  Getting 404 not found on IIS server when I run site locally
Getting 404 not found on IIS server when I run site locally

Time:11-12

I updated MVC3 to MVC4, since then I get lots of problems when I try to upload new version on iis servers this is what I get on server when I run it locally

if for example I will change reference to dll in web.config to be the previous one for example System.Web.Helpers from 2.0.0.0 to 1.0.0.0 I will get Server Error in '/' Application. if I have a look in event viewer I can see that the problem is Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. which is right. but when I fix it I get 404 and I totally not understand why. The resource I'm looking for has not been removed, had its name was not changed, and is available.

this is my 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>

when I try to change version of MVC4 dll in web.config to the previous version of MVC3 i get an error regarding it that it couldn't find assembly with version x and it's right. when I fixe it I expect to get successfully run, but eventually I get 404 not found

CodePudding user response:

There are many reasons for this error, you can try the following methods to solve the problem:

  1. Try to remove all binding redirect: bindingRedirect oldVersion="" newVersion="" />
  2. Change the .NET CLR version to v4.0.
  3. If it still doesn't work, please make sure the version of the dependencies of the current project is correct.

CodePudding user response:

actually I found the solution after so many hours of investigation. I had to remove the PrecompiledApp file from the project folder.

  • Related