views:

63

answers:

1

Is there anyway to disallow publishing Debug builds when publishing ClickOnce aplications using Visual Studio 2008?

I know this was asked before, but i can't figure out how from the answer. THe Accepted answer for previous question was:

One thing you can do is add a condition to the .csproj or .vbproj file that MSBuild will check when doing a build.

The condition would check if a publish is occurring and check if the build is a debug build, then do something like run an external tool or otherwise interrupt the build process or cause it to fail.

Could anyone elaborate on that answer or tell me where/or how I can add this condition.

Link to Original Question

+2  A: 

In Visual Studio (I'm using 2008), Tools->Options->Projects and Solutions->General. Then UNCHECK the option that says "Show advanced build configurations" (the 3rd check box on my screen). That should get you what you want. That is, the option between Debug and Retail will go away, and when you click F5 (etc.) from VS you will be debugging a project built in Debug mode, but when you Deploy via ClickOnce (or build an install package, etc.) it will use Retail mode.

Caveats: I haven't done this yet myself, but I asked Microsoft this question (at the PDC), and this was the answer I was given. Also, the Debug/Retail build options will STILL appear (and it won't work as above) if you have defined any additional modes (which is the case for the project I've been working on, which is why it's not yet working for me).

Andy Jacobs
I'm going to give this a go now, see if it works, get back to you in a sec. Thanks for the info :)
LnDCobra
Yeah it works, its a bit confusing for my class libraries, as i have previously included the debug .dll but now i need to change each refernce ot the build once, because if i rebuild it, it rebuilds it as "Release" but thanks for the info :)
LnDCobra