views:

243

answers:

4

Is there a way to have visual studio automatically copy files I save in a project to another location? I'm not looking for source control functionality, more along the lines of "automatic deployment". I work on my local machine but I want the files to automatically be tossed onto my dev box every time I edit them. Is there a way to do this?

A: 

You could use a post build event to copy the files (that would require you to compile the solution first, not sure if that is an issue for you)..

jonezy
+1  A: 

Set it up as a post build event.

Right click your project -> Properties -> Build Events (tab)

Then in post build events enter the command you wish to execute after the build is complete. Anything you would put in a batch file can be put in this textbox.

MSDN Post Build Events documentation and scenarios

Serapth
A: 

You can use cruise control .net on your dev box, but you really need to have a source control for this. Once you check in the application, cruise control will monitor changes and execute build on your dev box. You might need to configure you MSBuild to copy the output files or start/stop services, etc.

Regarding build events, etc., you may consider the following.

MSBUILD nANT RAKE (this is what I'm using now.)

Marc Vitalis
+1  A: 

It sounds like you're not looking for a post-build procedure, because you want every save (every time the file is touched) to trigger this process.

Since you're using Visual Studio, you're on Windows, which isn't my strong home base. Here's something I might try, and I'm certain you can find the Windows equivalent.

  1. Use rsync to do the actual update. You can connect via ftp, ssh, or direct file copy (you didn't mention how you will be connecting to the other box).

  2. Schedule the rsync command to run every n minutes.

A quick Google search turns up rsync replacements and wrappers for Windows, but I don't know enough to recommend one. As for scheduling, there's the Windows Scheduler and at on Windows.

Yes, this doesn't do it "on demand," but it's not a resource hog, and you can even run it every minute if you want.

ShawnMilo
This is more in line with what I'm looking for yes. I don't want a post-build procedure because for the most part I'm editing ASPX pages while the project is running which doesn't require a rebuild. If you can find any other info on this I'd really appreciate it. I'll check out rsync but I don't believe that will work.
Spencer Ruport