Deploying an ASP.NET MVC Application in Visual Studio 2008

Can I use the Copy Website tool in Visual Studio 2008 to deploy an MVC application to my hosting server? However, the Website menu doesn't even appear in Visual Studio with an MVC project open. What's the best practice for deploying an MVC application? Thank.

+2


source to share


4 answers


ASP.NET MVC is not a website, it is a web application. You need to expand it or just create and then copy.

Also, depending on your hosting company, you may not have the System.Web.MVC assembly available to you.



So, you need to deploy this to the bin directory as well. You can get it there by going to the links by selecting System.Web.MVC. Right click -? Properties. Then copy locally.

EDIT: [Including additional comments below just in case anyone misses this] you need to take an extra step before publishing the web app. You need to set the copy local attribute to true for the following System.Web.Mvc, System.Web.Routing and System.Web.Abstractions links. If you want, you can go directly to the official documentation.

+11


source


Right click, publish. If you want a very simple answer.



Best practice is a very broad question that accepts build scripts, tests, etc.

+1


source


The best practice is to have a script construct that automates the build, testing and deployment process, so all you have to do is run a batch file or command to run the whole thing. We do this very successfully using NAnt to build, test, test code coverage, and deploy to test the environment and production environment.

This saves an incredible amount of time without having to worry about what files to copy, where they go, and what configuration changes to make after deployment.

+1


source


I am very happy with the RTW Web Deployment Tool ( http://www.iis.net/extensions/WebDeploymentTool ). From Visual Studio 2008 Publish your web application locally to create content, and then use the web deployment tool to sync with the host server.

0


source







All Articles