I am attempting to build a project programmatically. I have the following code (C++):
CComQIPtr<Project> pProject;
...
hr = pSolutionBuild->get_ActiveConfiguration( &pConfig );
ATLASSERT( hr == S_OK );
CComBSTR bstrConfig;
pConfig->get_Name( &bstrConfig );
CComBSTR bstrProjectName;
pProject->get_Name( &bstrProjectName );
hr = pSolutionBuild->BuildProject( bstrConfig, bstrProjectName, TRUE );
...
I have confirmed that pProject points to a valid project in pSolution. I have tried using get_Name, get_FullName, and get_UniqueName, but the HRESULT returned from BuildProject only returns E_FAIL. I have no idea what the cause is.
Anyone have any ideas what is going on?