System.InvalidOperationException: The controller for path '/Default.aspx' could not be found or it d

Discussion in 'ASP.NET / ASP.NET Core' started by girmadere, Feb 22, 2008.

  1. Hi,
    I have created a ASP.NET MVC Framework based application using ASP.NET MVC, Silverlight and LINQ to SQL 2K5.
    It is working perfectlly on my localhost ASP.NET development web server on a Windows Vista machine. But, when I upload it to the discountasp.net web server I got the following error messages.

    Please following the following link if you want to repro this message. http://ethiokicks.com/. Everything is working fine on my development box. Can you please help?

    I have referenced this link, http://forums.asp.net/t/1213688.aspx, to resolve this issue but doesnt' help.

    -----------------------------

    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.InvalidOperationException: The controller for path '/Default.aspx' could not be found or it does not implement the IController interface.

    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.
     
  2. Until the official release of the 3.5 templates we don't have MVC available to us on DASP live servers.
    Don't fret, the DASP crew is working closely with Microsoft for the release here.
    Salute,
    Mark
     
  3. That surely looks like an issue with the MVC and I don't think it will be part of the 3.5 framework either.You got to wait until MSFT announces something (somewhere around Summer 08 or later ).

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. Full details on my blog post, http://geekswithblogs.net/twickers/archive/2008/03/10/120454.aspx, but basically I solved the issue with MVC Preview 2 (March CTP) by changing the controller routing to use the file extension '.mvc.aspx' and it all works fine on my DiscountASP shared hosting site.

    Go into Global.asax.cs, and update the routing as follows;

    routes.Add(new Route('{controller}.mvc.aspx/{action}/{id}', new MvcRouteHandler())
    {
    Defaults = new RouteValueDictionary(new { action = 'Index', id = '' }),
    });

    The Default.aspx page still works, as will other .aspx pages, however the URLs for the controllers will now include the .mvc.aspx extension, i.e. ~/Home.mvc.aspx/About.

    If we are really polite, we could ask the guys as DiscountASP to just register the '.mvc' extension to route to the ASP.NET ISAPI filter, but to be honest, I'm happy to have the file extension solution for the moment. It is a beta / CTP after all, even if it does have a 'go live' licence.
     

Share This Page