I have written a C++ VSPackge which has code like this
// Command handler called when the user selects the "My Command" command. void OnMyCommand(CommandHandler* /pSender/, DWORD /flags/, VARIANT* /pIn/, VARIANT* /pOut/) { HRESULT hr = S_OK;
CComPtr<IVsDebugger> spDebugger = nullptr;
hr = this->GetVsSiteCache().QueryService<IVsDebugger>( IID_IVsDebugger, &spDebugger );
if(FAILED( hr ))
{
return;
}
DBGMODE dbgMode;
hr = spDebugger->GetMode( &dbgMode );
if(FAILED( hr ))
{
return;
}
if(dbgMode == DBGMODE::DBGMODE_Design)
{
// Need to get the current project's debug settings before calling
// IVsDebugger::Launch**
}
I tried to get different services (IVsProjectCfg, IVsSolutionBuildManager) all of which failed.