public virtual int OpenProjectCfg(string projectCfgCanonicalName, out IVsProjectCfg projectCfg)
{
if (projectCfgCanonicalName == null)
throw new ArgumentNullException("projectCfgCanonicalName");
if (string.IsNullOrEmpty(projectCfgCanonicalName))
throw new ArgumentException("projectCfgCanonicalName cannot be null or empty");
projectCfg = null;
// Be robust in release
if(projectCfgCanonicalName == null)
{
return VSConstants.E_INVALIDARG;
}
Debug.Assert(this._project != null && this._project.BuildProject != null);
string[] configs = GetPropertiesConditionedOn(ProjectFileConstants.Configuration);
string[] platforms = GetPlatformsFromProject();
foreach (string config in configs)
{
foreach (string platform in platforms)
{
if (string.Equals(string.Format("{0}|{1}", config, platform), projectCfgCanonicalName, StringComparison.OrdinalIgnoreCase))
{
projectCfg = this.GetProjectConfiguration(config, platform);
if (projectCfg != null)
return VSConstants.S_OK;
else
return VSConstants.E_FAIL;
}
}
}
return VSConstants.E_INVALIDARG;
}