views:

79

answers:

2

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.

+1  A: 

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.

pdr
+1  A: 

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.

DM
How about the views then? Do you use the an embedded view engine? Otherwise, one needs to deploy them too, right?
mnemosyn
The Views are in the "Views" folder listed above. Since there are typically no .cs files in your Views folder you can just ftp the entire folder over. Just make sure the web.config file that is inside your views folder goes with it.
DM
D'oh. Never mind. Not enough coffee / not enough sleep!
mnemosyn