I will deploy my first MVC web application to the net.
Out of the box the very first application with this particular framework for me personally, I'm wondering basically can collect some advices regarding what ought to be done to avoid troubles.
I'm generic about the question which is xpressely completed to collect probably the most various solutions.
Thanks everyone for the solutions. The question doesn't just regards the "deploy" scope but much more these scopes:
- Public Hosting
- Application Management &lifier Procedures
In a nutshell, all of the problem that should be addressed in the initial deploy on.
If you are planning to deploy inside the hour:
Make certain the mention of the System.Web.Mvc is marked as Copy Local=True inside your project. It has a tendency to default to False, and thus won't be replicated for your bin folder, leading to the application to fail when used. Review any extra devices you might have put into the task for Copy Local=True.
Make certain stack traces aren't proven to clients when the best happens inside your code. Make use of the
<customErrors>in web.config to specify your personal error page(s).
Inside your web.config, make certain the connection strings works about the server you will be implementing to.
Is the application conntacting disk unconditionally? Logging possibly? Some hosting services won't let your application email disk -- worth checking in advance.
Deploy to some local folder, and sanity-make sure that released application. Are scripts, stylesheets, images loaded without glitches?
For those who have a bit more time to deal with:
Evaluate the code for security, XSS factors: are inputs disinfected? Is user input encoded properly when made in sights?
Evaluate the data schema. This might be your last chance to change a clear database. When you deploy, you only hope to become lightly upgrading live data, attempting to avoid doing harm to existing data and dependencies in application logic.
Should you haven't already, make certain to setup a google statistics account. You are likely to be interested in how your internet site is getting used, which is among the best free tools available. Goog statistics, in addition to internet search engine sign ups will need you to place files with funky names within the root 'folder' of the domain title. Verify that the application can serve files in the root folder, or setup a controller+routing to take care of individuals demands.
If you're implementing your MVC site in your server with IIS 5.1 or 6:
- Make certain to include mapping for extension .* with executable road to
GET,Mind,Publish,DEBUGnot essential in IIS 7.
- If you're adding your MVC application in root website, do one in the main website e.g.
Default Siteif on the Virtual Directory do one in Virtual Directory.
- Make certain all scripts and css includes finds the right path when used.
If you're implementing your MVC site inside a hosting that is shared, where you do not have an use of the IIS configurations.
- Make certain you've added the best httpHandlers inside your web.config to the url rewritting can map properly right pages.
- One other way would be to add custom Routing inside your MapRoutes. e.g. then add extension (.aspx) inside your Default maproute. (
.aspx//). But I don't advice this.
Palermo, Bogard etc. 's book ASP.Internet MVC 2 for action, from Manning is loaded with info on using MVC, and it has an instalment devoted to Deployment Techniques readily available for free at: http://github.com/jeffreypalermo/mvc2inaction/tree/master/manuscript/Chapter17/
I believe this can most likely have all you need.