根据解决方案是否编译/构建没有错误,我需要在构建完成时处理特定的逻辑。
如何检测最后一次构建是否产生任何错误?
vsBuildState 包含 Done、InProgress 和 NotStarted 的定义,我在哪里检查错误?
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
_buildEvents = _applicationObject.Events.BuildEvents;
_buildEvents.OnBuildBegin += customBuildHandler;
_buildEvents.OnBuildDone += customBuildEndHandler;
}
void customBuildEndHandler(vsBuildScope Scope, vsBuildAction Action)
{
if(IsLastBuildSuccessful) // How can I determine this?
{
//Do Something
}
}