Note that there are some explanatory texts on larger screens.

plurals
  1. POasp.net mvc 3 iis 7.5 404 error
    text
    copied!<p><strong>EDIT</strong></p> <p>Well works fine on my dev machine if I'm using Visual Development Server. However, if I set to Use Local IIS WebServer (project url set at <code>http://localhost/myapp</code>) it DOESN'T work I get a 401 error.</p> <p>Deploys fine from visual studio 2010 using msdeploy to IIS 7.5 with a site named apps.mydomain.com/myapp. So essentially I want to browse to <a href="http://apps.mydomain.com/myapp" rel="nofollow">http://apps.mydomain.com/myapp</a> but when I do I get 404 error.</p> <ul> <li>I have Windows authentication enabled only on the site everything else is disabled.</li> <li>I have installed hotfix <a href="http://support.microsoft.com/kb/980368" rel="nofollow">http://support.microsoft.com/kb/980368</a>.</li> <li>App pool .NET 4 integrated pipeline. I have tried classic pipeline also but doesn't work.</li> <li>executed %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir still doesn't work</li> </ul> <p>What am I doing wrong or do I need to do anything else?</p> <p>Global.asax</p> <pre><code>public class MvcApplication : System.Web.HttpApplication { public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new AuthorizeAttribute()); filters.Add(new HandleErrorAttribute()); } public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" }); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); } protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); } } </code></pre> <p>Web.config</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;configuration&gt; &lt;configSections&gt; &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt; &lt;sectionGroup name="elmah"&gt; &lt;section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" /&gt; &lt;section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" /&gt; &lt;section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" /&gt; &lt;section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" /&gt; &lt;/sectionGroup&gt; &lt;/configSections&gt; &lt;appSettings&gt; &lt;add key="webpages:Version" value="1.0.0.0" /&gt; &lt;add key="ClientValidationEnabled" value="true" /&gt; &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt; &lt;add key="elmah.mvc.disableHandler" value="false" /&gt; &lt;add key="elmah.mvc.disableHandleErrorFilter" value="false" /&gt; &lt;add key="elmah.mvc.requiresAuthentication" value="false" /&gt; &lt;add key="elmah.mvc.allowedRoles" value="*" /&gt; &lt;add key="elmah.mvc.route" value="elmah" /&gt; &lt;add key="autoFormsAuthentication" value="false" /&gt; &lt;add key="enableSimpleMembership" value="false" /&gt; &lt;/appSettings&gt; &lt;system.web&gt; &lt;customErrors mode="On" defaultRedirect="~/error"&gt; &lt;error statusCode="404" redirect="~/error/notfound"&gt;&lt;/error&gt; &lt;/customErrors&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt; &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;authentication mode="Windows" /&gt; &lt;pages&gt; &lt;namespaces&gt; &lt;add namespace="System.Web.Helpers" /&gt; &lt;add namespace="System.Web.Mvc" /&gt; &lt;add namespace="System.Web.Mvc.Ajax" /&gt; &lt;add namespace="System.Web.Mvc.Html" /&gt; &lt;add namespace="System.Web.Routing" /&gt; &lt;add namespace="System.Web.WebPages" /&gt; &lt;/namespaces&gt; &lt;/pages&gt; &lt;httpModules&gt; &lt;add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /&gt; &lt;add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /&gt; &lt;add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" /&gt; &lt;/httpModules&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;httpErrors errorMode="Custom" existingResponse="Replace"&gt; &lt;remove statusCode="404" /&gt; &lt;error statusCode="404" responseMode="ExecuteURL" path="~/error/notfound" /&gt; &lt;remove statusCode="500" /&gt; &lt;error statusCode="500" responseMode="ExecuteURL" path="~/error" /&gt; &lt;/httpErrors&gt; &lt;validation validateIntegratedModeConfiguration="false" /&gt; &lt;modules runAllManagedModulesForAllRequests="true"&gt; &lt;add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" /&gt; &lt;add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" /&gt; &lt;add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" /&gt; &lt;/modules&gt; &lt;/system.webServer&gt; &lt;runtime&gt; &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt; &lt;bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; &lt;entityFramework&gt; &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /&gt; &lt;/entityFramework&gt; &lt;connectionStrings&gt; &lt;/connectionStrings&gt; &lt;elmah&gt; &lt;errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Elmah.Sql" /&gt; &lt;security allowRemoteAccess="true" /&gt; &lt;/elmah&gt; &lt;location path="elmah.axd" inheritInChildApplications="false"&gt; &lt;system.web&gt; &lt;httpHandlers&gt; &lt;add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /&gt; &lt;/httpHandlers&gt; &lt;authorization&gt; &lt;allow roles="admin" /&gt; &lt;deny users="*" /&gt; &lt;/authorization&gt; --&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;handlers&gt; &lt;add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" /&gt; &lt;/handlers&gt; &lt;/system.webServer&gt; &lt;/location&gt; &lt;/configuration&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload