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?)
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With