Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 在运行外部工具之前,有没有办法让Visual Studio保存文件?_Visual Studio_Visual Studio 2008 - Fatal编程技术网

Visual studio 在运行外部工具之前,有没有办法让Visual Studio保存文件?

Visual studio 在运行外部工具之前,有没有办法让Visual Studio保存文件?,visual-studio,visual-studio-2008,Visual Studio,Visual Studio 2008,我已经设置了两个外部工具,可以在当前显示的文件或当前活动的项目上运行Doxygen 令人恼火的是,在运行该工具之前,似乎没有任何地方可以保存文件 因此,我将敲入一些Doxygen块,点击热键运行Doxygen,切换到Firefox以检查输出,当然。。。。。这是以前的版本 唉 关于如何以一种好的方式实现这一点,有什么线索吗?习惯于尽可能频繁地按Ctrl+S键,或者在VS:Ctrl+Shift+S键中使用得更好。:) (说真的。我已经习惯了这样做,Firefox经常弹出“另存为”对话框来保存这个网站

我已经设置了两个外部工具,可以在当前显示的文件或当前活动的项目上运行Doxygen

令人恼火的是,在运行该工具之前,似乎没有任何地方可以保存文件

因此,我将敲入一些Doxygen块,点击热键运行Doxygen,切换到Firefox以检查输出,当然。。。。。这是以前的版本

关于如何以一种好的方式实现这一点,有什么线索吗?

习惯于尽可能频繁地按Ctrl+S键,或者在VS:Ctrl+Shift+S键中使用得更好。
:)


(说真的。我已经习惯了这样做,Firefox经常弹出“另存为”对话框来保存这个网站,因为我在so中键入答案时按了Ctrl+S。)

你可以创建一个VS宏,首先保存所有文件,然后保存外部工具

如果您使用的是Visual Studio 2012或更高版本,则不再有宏

我用一个脚本来填补这个空白,解决了这个问题

我是这样做的:

SetTitleMatchMode, 2       ; Title matches if it contains string

#IfWinActive Visual Studio ; The shortcuts below this line are valid when Visual Studio is active
!s::                       ; Alt+s to activate the external tool
    SendInput ^s           ; Sends Ctrl+s to Visual Studio to save the file
    Sleep, 100
    SendInput ^!+\         ; Actual shortcut that activates the desired external tool
return
#IfWinActive               ; Shortcuts below this line will be global

我在VS2013中通过使用找到了解决方案。这将使您恢复运行宏的能力。您现在可以创建一个宏来保存所有文件,然后运行外部工具,例如

Imports EnvDTE
Imports EnvDTE80
Imports Microsoft.VisualBasic

Public Class C
    Implements VisualCommanderExt.ICommand

    Sub Run(DTE As EnvDTE80.DTE2, package As Microsoft.VisualStudio.Shell.Package) Implements VisualCommanderExt.ICommand.Run
        DTE.ExecuteCommand("File.SaveAll")
        DTE.ExecuteCommand("Tools.ExternalCommand6" )
    End Sub
End Class
现在可以将此宏添加到工具栏或键盘快捷键,而不是直接运行外部工具。

使用Visual Studio 2005。 它会在运行外部工具之前自动保存所有文件


(我意识到这通常不会有帮助,但当我同时使用2005年和2012年时,这是我2012年的主要烦恼之一)

是的,我可以做到。令人恼火的是,该功能只支持构建等,而不支持外部工具。唉,是的,我看到了。然而,正如我所说的,基本上我从来没有遇到过这种情况,因为我太习惯于储蓄了,当我们进行结对编程时,我的同事对我每次微小的改变后都会储蓄感到恼火<代码>:)