weilin8
weilin8

Reputation: 2985

Deploying ASP.NET MVC application in Visual Studio 2008

Can I use the Copy Web Site tool in Visual Studio 2008 to deploy MVC application to my hosting server? However, the Web Site menu doesn't even show up in Visual Studio with MVC project opened. What's the best practice to deploy MVC application? Thanks.

Upvotes: 2

Views: 1275

Answers (4)

Rudy
Rudy

Reputation: 895

I'm very happy using the now RTW Web Deployment Tool (http://www.iis.net/extensions/WebDeploymentTool). From Visual Studio 2008 I Publish the web application locally to stage the content and then use the Web Deployment Tool to synchronize with the host server.

Upvotes: 0

Jack Marchetti
Jack Marchetti

Reputation: 15754

ASP.NET MVC isn't a web site it's a Web application. You need to Deploy it, or just build it then copy it.

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

So you'll need to deploy that as well in your bin directory. You can get it there by going to references, selecting System.Web.MVC. Right click -? Properties. Then Copy Locally.

EDIT: [Including extra comments from below just in case anyone misses it] you need to do an extra step prior publishing the web application. You need to set the copy local attribute to true to the following references System.Web.Mvc, System.Web.Routing and System.Web.Abstractions. If you want you can go directly to the official documentation.

Upvotes: 11

Chris Conway
Chris Conway

Reputation: 16529

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

It saves an incredible amount of time not having to remember what files need copied, where they go and what configuration changes need made once deployed.

Upvotes: 1

dove
dove

Reputation: 20692

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

The best practice is a very wide question that takes in build scripts, tests, etc.....

Upvotes: 1

Related Questions