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