我正在尝试通过创建一些宏来优化我的VS工作。目前我有以下宏:
Public Sub ReleaseBuild()
DTE.ExecuteCommand("Build.SolutionConfigurations", "Release")
DTE.ExecuteCommand("Build.RebuildSolution")
End Sub
Public Sub DebugBuild()
DTE.ExecuteCommand("Build.SolutionConfigurations", "Debug")
DTE.ExecuteCommand("Build.RebuildSolution")
End Sub
我想要的是在重新构建之前清理解决方案。我的做法如下:
Public Sub ReleaseBuild()
DTE.ExecuteCommand("Build.SolutionConfigurations", "Release")
DTE.ExecuteCommand("Build.CleanSolution")
DTE.ExecuteCommand("Build.RebuildSolution")
End Sub
Public Sub DebugBuild()
DTE.ExecuteCommand("Build.SolutionConfigurations", "Debug")
DTE.ExecuteCommand("Build.CleanSolution")
DTE.ExecuteCommand("Build.RebuildSolution")
End Sub
但是我得到了以下错误:
alt text http://img23.imageshack.us/img23/2667/errorcb.png
我相信在重新构建之前必须先进行清理。我知道可以通过运行两个单独的宏来完成此操作,但我实际上想用一个点击来实现它。最好的问候,
Kiril