Asp – Deploying ASP.NET MVC application in Visual Studio 2008

asp.net-mvcdeploymentnetvisual studiovisual-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.

Best Answer

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.