How to deploy MVC app to shared hosting?

Last post 06-30-2008 4:47 AM by oazabir. 7 replies.

Sort Posts:

  • How to deploy MVC app to shared hosting?

    03-28-2008, 10:31 AM
    • Loading...
    • Prem M
    • Joined on 03-22-2008, 3:16 AM
    • Posts 2

    Hello,

    How to deploy an MVC app to shared hosting (I am using ReliableSite.net shared hosting Windows 2008 , IIS7 . 3.5 .NET)? 

    I have created the sample MVC app detailed at Walkthrough: Creating a Basic MVC Project in Visual Studio , but have no idea as to what files to upload to a shared hosting account and what to configure in web.config.

    The sample MVC app works fine on my desktop thru VS2008 Pro.

    For now, I tried uploading the full project with web.config , bin folder , and everything else as it is. When I visit the website, I get the home page "Introduction to ASP.NET MVC Application!", but clicking the Login link ( Login/Login) in menu results in

    -------------------------
    Server Error
    404 - File or directory not found.
    The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
    -------------------------

    I have no prior experience with ASP.NET and am a newbie at ASP.NET MVC. I hope I don't have to learn ASP.NET first to learn MVC? Do I, hope not!

    I have software development experience, just none for web development, so step by step help or a link to webpage with step by step instructions, to get the sample MVC running in shared hosting would be appreciated. 

    Deployment is a whole new beast for me. So please, step by step. Smile

    Thanks,
    Prem

  • Re: How to deploy MVC app to shared hosting?

    04-13-2008, 9:24 AM
    • Loading...
    • mehfuzh
    • Joined on 09-28-2007, 3:02 PM
    • Posts 6

    If *.mvc extension is not registered to the hosting , it will give 404 exception. The working way of hosting MVC apps in that case is to modify global.asax routing caluse in the following way.

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

    In this way all your controller request will end up in *.mvc.aspx, which is recognized by your hosting. And as the MVC dlls are copied into your local bin , no special setttings need to be done for it.

    Hope this helps

    Thanks,
    Mehfuz Hossain.
    http://weblogs.asp.net/mehfuzh
    Filed under:
  • Re: How to deploy MVC app to shared hosting?

    04-13-2008, 10:47 AM
    • Loading...
    • srulyt
    • Joined on 02-02-2008, 6:16 PM
    • Posts 209

    Prem M:

    I have no prior experience with ASP.NET and am a newbie at ASP.NET MVC. I hope I don't have to learn ASP.NET first to learn MVC? Do I, hope not!

    DotNet experience is important but you don't have to know asp.net

    Prem M:

    How to deploy an MVC app to shared hosting (I am using ReliableSite.net shared hosting Windows 2008 , IIS7 . 3.5 .NET)? 

    if iis 7 is set to integrated pipeline it should work without having to add any extensions if not you will have to add extensions to your routes like shown above.

    many hosting providers allow you to change between integrated and classic pipelines. you should ask your webhost for more info in that regard

  • Re: How to deploy MVC app to shared hosting?

    05-01-2008, 7:55 PM
    • Loading...
    • philgeorge
    • Joined on 03-06-2008, 4:16 AM
    • Melbourne, Australia
    • Posts 3

    I am deploying and asp.net mvc application with reliablesite.net, and I have just succeeded in getting it working with extensionless URLs.

    srulyt was correct - you need to set the IIS7 ASP.NET integrated pipeline on. For reliablesite.net, go into your DotNetPanel management interface, select your website and then the Extensions tab. Here they have an option to switch the ASP.NET option from "2.0" to "2.0 Integrated Pipeline". This should do the trick.

    Cheers

    Phil

    Phil George
  • Re: How to deploy MVC app to shared hosting?

    05-02-2008, 5:39 AM
    • Loading...
    • gyan_flip
    • Joined on 04-25-2008, 11:08 AM
    • बाघी - भोजपुर - बिहार - भारत
    • Posts 70

    If you are using IIS6, then add .mvc extension in in the url routing. If you are using IIS7 then its use integrated pipeline.

    ज्ञान [Gyan]
  • Re: How to deploy MVC app to shared hosting?

    05-02-2008, 5:42 AM
    • Loading...
    • gyan_flip
    • Joined on 04-25-2008, 11:08 AM
    • बाघी - भोजपुर - बिहार - भारत
    • Posts 70
  • Re: How to deploy MVC app to shared hosting?

    05-03-2008, 7:02 AM
    • Loading...
    • Prem M
    • Joined on 03-22-2008, 3:16 AM
    • Posts 2

    Thanks to all who replied.

    srulyt's tip is correct. I had not enabled integrated pipeline. Once I did that, it started working.

     

  • Re: How to deploy MVC app to shared hosting?

    06-30-2008, 4:47 AM
    • Loading...
    • oazabir
    • Joined on 12-31-2005, 11:45 AM
    • Kuala Lumpur, Malaysia
    • Posts 7
    Please check out this article that might solve the 404 problem: http://msmvps.com/blogs/omar/archive/2008/06/30/deploy-asp-net-mvc-on-iis-6-solve-404-compression-and-performance-problems.aspx
    Regards,
    Omar AL Zabir
    Filed under:
Page 1 of 1 (8 items)
Microsoft Communities
Page view counter