views:

43

answers:

4

Once an asp.net MVC project has a web deployment project associated with it, there doesn't seem to be a way to avoid deploying when you build the MVC project. I still want to be able to debug my MVC project locally and avoid deploying new versions of it. How do I configure the web deployment project to skip the deployment step when I'm trying to debug?

To clarify this question a little: I want the build process to deploy when I'm doing a release build, and not deploy when I'm doing a debug build. There should be a way to configure this without having to manually modify the projects in my solution every time I switch between debug and release builds.

+3  A: 

Unload your deployment project. (Right click on project in VS -> Unload Project) and Reload it when you actually want to deploy

LorenVS
Thanks for the unload suggestion, but that's not practical for our VS solutions. We have frequently have multiple deployment projects in a sln, and if you forget to unload them first, you're stuck with a frozen VS IDE for a while before you can cancel the build. I also don't know what impact this would have for our automated builds if the sln is saved that way.
John Kaster
This setting, I believe, is saved in the .suo file which should not be checked into source control and therefore never affect your automated builds. They are definitely NOT stored in the .sln file.
Jaxidian
+1  A: 

Right-click on your web deployment project and select the "Unload Project" option. This is a quick/easy/temporary solution that will let you do what you want to do. Trust me, I know how painful it is to wait for deployment packages to compile and build! :-)

Jaxidian
Thanks for the answer. It's a good workaround, but not really a answer to my question.
John Kaster
+1  A: 

In the solution properties, expand Configuration Properties and go to the Configuration item. Each appropriate project has a Deploy Check Box.

I use this to keep reporting projects from deploying on every build.

Cheddar
+1 for good information, and "appropriate project"
Jim Schubert
Thanks for the suggestion, but unless I'm missing something this appears to be another manual intervention solution. I saw an option to set the deployment project was for release builds only, so I did that. I then did a debug build and it still deployed. Unless I'm missing something, this isn't working either. Oh yeah, this is VS 2008.
John Kaster
With the help of a colleague, I was finally able to use this option to do the appropriate configuration. The steps outlined here aren't really clear, but as long as you load the configuration manager button and set the build options for each configuration you should be able to turn off building for debug mode.
John Kaster
A: 

Have two different solutions: 1 where you do not include deployment Projects and one where you include your deployment projects.

This will allow you to choose, when you open up your solution, whether you want to develop with the application code or with the application + deployment code.

Jaxidian