0

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.

4 Answers 4

3

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

Sign up to request clarification or add additional context in comments.

2 Comments

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.
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.
1

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.

2 Comments

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.
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.
1

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! :-)

1 Comment

Thanks for the answer. It's a good workaround, but not really a answer to my question.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.