我正在尝试通过创建一些宏来优化 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
但我收到以下错误:
替代文本http://img23.imageshack.us/img23/2667/errorcb.png http://img23.imageshack.us/img23/2667/errorcb.png
我认为重建之前必须先进行清洁工作。我知道这可以通过运行两个单独的宏来完成,但我实际上想通过单击来实现。
此致,
Kiril
重建不首先清理解决方案
我从处理很多项目时的经验知道,当我将参数添加到一个项目中的方法并从第二个项目调用该方法并实现附加参数时,我知道这一点rebuild考虑到该方法中的参数数量,经常会显示错误!
use
DTE.Solution.SolutionBuild.Clean(True)
DTE.Solution.SolutionBuild.Build(True)
not
DTE.ExecuteCommand("Build.CleanSolution")
DTE.ExecuteCommand("Build.RebuildSolution")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)