Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the best way to FTP deploy an asp.net mvc site

right now i am simply ftping everything (all of my source code included) but i figured there was a best practices way to get the right dlls and the right aspx files to deploy.

like image 678
leora Avatar asked Mar 06 '10 14:03

leora


2 Answers

Despite some other tools I feel the best approach is to develop an understanding of the files needed to run the app and upload them appropriately. Depending on how you organize your application you'll be surprised at how simple it is to upload an MVC app. Here's what I do and I hope it helps:

  1. I create a folder in the root of my web app called "assets." In the folder you'll find sub-folders for "css", "js", "images", and "type". I do this for organization as well as when I upload I don't have to find several folders (Content, Scripts, Css, etc) I just upload "assets".
  2. I make sure my supporting class libraries, when built, copy their .dll to my web app's bin folder. That way all necessary .dll's are in the web app's bin folder.

I then upload the following files and folders:

  • assets
  • bin
  • Views
  • Default.aspx
  • Global.asax
  • web.config (production version)

Very simple and not very scary. This is a little simplified as I almost always have other folders and files I use (sitemap.xml, robot.txt, favicon.ico, App_Data (sometimes), etc, etc) but the above is the bare minimum needed. Works great for small to medium sites.

like image 143
DM. Avatar answered Sep 28 '22 01:09

DM.


You can build into a different build folder, using msbuild /p:OutputDir=Build\, which will eliminate extraneous files, then FTP that build folder.

I'm eager to see if anyone has better answers though. Good question.

like image 34
pdr Avatar answered Sep 28 '22 01:09

pdr