开发者

VS2008: Save All before running custom tools

When running an external tool in VS 2008, open modified fiels aren't save anymore before the tool executes. That's a PITA change from VC6, and开发者_如何转开发 has caused us a lot of trouble already.

Is there any way to get this functionality back?


A simple approach for this sort of problem is to use a macro (2 lines of code would probably suffice). Once built the macro can be easily executed from the macro explorer or assigned to a hotkey.

e.g.

File.SaveAll()
DTE.ExecuteCommand ("Tools.ExternalCommand7")

(Tip: You can find out what the command you need to execute is by recording a temporary macro (often ctrl+shift+R), executing your tool, stopping recording (ctrl+shift+R again) and then going to Tools->Macros->Macros IDE and opening up the temporary macro's code).

(If you don't know how to use VS macros and the temporary macro, then I suggest you learn a bit about them - they are absolutely awesome time savers once you get to know how to use them).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜