views:

155

answers:

1

I'm obviously developing in debug mode. If I'm starting with the standard run command (F5) my project should start in debug mode but if I publish my project it should automatically switch in release mode. Is this possible somehow, maybe even with scripting?

A: 

You could easily write a macro in VBA that was bound to a command in VS which switched to release mode, did your full rebuild, and fired off any other publishing/packaging required. I've done this before.

The object model for VS automation is very feature complete.


Edit:

Debug/Release in VS are configuration properties. Here's the MSDN page on accessing/modifying this.

Once you've set that, you should be able to use DTE.ExecuteCommand to start a build (or do anything else that's available via menus, etc).

Reed Copsey
Thanks Reed, nice idea (although I hoped it would be *easier*). Do you know a link which describes the required commands?
Added some details to my answer..
Reed Copsey
I've played a little bit with the macro recorder and think that I'll get along. Thanks.
Keselogof, could you please share more info on it?
balint