private MSBuildExecution.ProjectPropertyInstance GetMsBuildProperty(string propertyName, bool resetCache)
{
if (resetCache || this.currentConfig == null)
{
// Get properties from project file and cache it
this.SetCurrentConfiguration();
this.currentConfig = this.buildProject.CreateProjectInstance();
}
if (this.currentConfig == null)
throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, SR.GetString(SR.FailedToRetrieveProperties, CultureInfo.CurrentUICulture), propertyName));
// return property asked for
return this.currentConfig.GetProperty(propertyName);
}