Note that there are some explanatory texts on larger screens.

plurals
  1. POHosted MVC3 app, only directory listing. Routing not working?
    primarykey
    data
    text
    <p>Ok so deploying to local IIS my project works fine. Deploying to the online host, I only get directory listing.</p> <p>(</p> <p>Using VisualStudio 2012, mvc3, .net 4.5 Publish to Web settings:</p> <ol> <li>Publish method: FTP</li> <li>Server: <code>www."mysite".co.za</code></li> <li>Site Path: "blank" (My understanding is that I'm publishing directly to the app directory, so my root contains bin, views, global.asax, web.config)</li> <li>Destination URL: <code>http://www."mysite".co.za</code></li> <li>Databases are already up and configured in web.config</li> </ol> <p>)</p> <p>If click on the Views directory I get the 404 error.</p> <p>What I did next was to see if it executes global.asax, so I added code to throw an exception in RegisterRoutes (Called from Application_Start())</p> <pre><code> public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); throw new Exception("This is my custom error: Currently in RegisterRoutes"); } </code></pre> <p>And true's Bob, I get the following (<strong>but still only if I click on my View directory</strong>):</p> <pre> <H1>Server Error in '/' Application.</H1> <h2> <i>This is my custom error: Currently in RegisterRoutes</i> </h2> <b> Description: </b>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. <b> Exception Details: </b>System.Exception: This is my custom error: Currently in RegisterRoutes</pre> <p>So my questions: 1. Why would my root not pick up global.asax? 2. How can I see where execution of code ends after routes.MapRoute(...)? (that is, after removing the throw Exception ;) )</p> <p>Regards</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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