8

We all know that we should only be publishing our ASP.NET Web Applications with release build type, so why do I not get a warning when I trigger the "Publish" command in Visual Studio 2008, for a project configured to build in debug mode?

Sure, there might be cases where I need to publish a debug build to a development or test environment, but answering yes in a confirmation dialog would be acceptable in these cases. Is there an option that I have overlooked, forcing Visual Studio to warn me every time I try to publish a debug build?

Yes, we could just ban using the "Publish" command and use a more solid build management tool, but this involves a change of process and might not be an option in this particular case.

1
  • I am sorry if my question seems "subjective and argumentative". What I want to know, is merely if a specific option is available or not in Visual Studio. Commented Feb 17, 2010 at 15:35

3 Answers 3

6

Typically things like this are handled in an automated build tool. Quite frankly, I publish to a dev site by orders of magnitude more often than I do to production.

For that reason alone having an extra dialog box in the process would be a bit maddening.

Further, even without a build system in place, most people have different config files for the different environments and for the most part handle it with a web.config setting.

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

1 Comment

Good point about ratio of dev/prod publishing. I don't get the web.config comment, though. Setting debug=false in web.config is a completely different thing, right?
3

I use Publish to build and publish my development sites to the dev servers all the time, a question about this would just be irritating in my opinion.

I think the issue here is one of your personal process rather than the tool. Production releases should be far less frequent and would require you to change the location the site is being published to, if you remember to change that then it's not too much to also expect that you are publishing the correct build type.

1 Comment

Good point about ratio of dev/prod publishing. The development process here does not involve publishing a lot of development builds, as most debugging is done locally. This might not be optimal, and - yes - it's a matter of process, which I might not be able to change, as I am merely a wretched contractor.
3

You can set deployment retail="true" in your production server machine.config to stop worrying about it

<configuration>
    <system.web>
          <deployment retail="true"/>
    </system.web>
</configuration>

Tip from Scott Guthrie's article Don’t run production ASP.NET Applications with debug=”true” enabled

1 Comment

Please see the last half of my comment at Chris' answer.

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.