in src/Microsoft.VisualStudio.SlnGen/ProjectLoading/LegacyProjectLoader.cs [108:153]
private bool TryLoadProject(string path, string toolsVersion, ProjectCollection projectCollection, IDictionary<string, string> globalProperties, out Project project)
{
project = null;
bool shouldLoadProject;
string fullPath = path.ToFullPathInCorrectCase();
lock (_loadedProjects)
{
shouldLoadProject = _loadedProjects.Add(fullPath);
}
if (!shouldLoadProject)
{
return false;
}
long now = DateTime.Now.Ticks;
try
{
project = new Project(fullPath, globalProperties, toolsVersion, projectCollection, DefaultProjectLoadSettings);
ProjectLoader.LogProjectStartedEvent(_logger, project.CreateProjectInstance(ProjectInstanceSettings.ImmutableWithFastItemLookup, ProjectLoader.SharedEvaluationContext));
}
catch (InvalidProjectFileException e)
{
_logger.LogError(e.Message, e.ErrorCode, e.ProjectFile, e.LineNumber, e.ColumnNumber);
return false;
}
catch (Exception e)
{
_logger.LogError(message: e.ToString());
return false;
}
if (CollectStats)
{
Statistics.TryAddProjectLoadTime(path, TimeSpan.FromTicks(DateTime.Now.Ticks - now));
}
return true;
}