Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What files do I need to deploy for ASP.NET mvc?

Tags:

I know I can just copy all of my files from my development environment into my live website directory, but then I know I'm copying several files that aren't necessary (e.g. the .sln file and .csproj files).

What files actually have to be copied for ASP.NET MVC web applications to run? (E.g. Do I need to copy all .CS files?)

like image 283
Jim Avatar asked Apr 10 '09 17:04

Jim


2 Answers

If you develop in Microsoft Visual Studio, you can use the Build > Publish option (when you're in the context of an ASP.NET MVC project) and publish it directly.

If you cannot use this and have to do a copy all you need is anything that ISN'T a .cs file (views, .config files etc) and your compiled ASP.NET MVC site's .dll (ex MvcApplication1.dll). If you want to get an idea of what you need use the Build > Publish tool to a local directory and take a look at what's in there.

You don't need solution or project files.

like image 191
Chad Moran Avatar answered Oct 30 '22 06:10

Chad Moran


Using the Build / Publish approach is the best to ensure you have the files you need. Before building though, if you don't have ASP.NET 3.5 SP1 installed on your server, make sure you go into the references in your project for the following assemblies and set the to "Copy Local" in each of their respective property pages.

System.Web.MVC System.Web.Routing System.Web.Abstractions

This will make sure that each of these assemblies is copied to your "bin" folder on the published site.

Brian

like image 26
Brian Behm Avatar answered Oct 30 '22 06:10

Brian Behm