in src/Microsoft.VisualStudio.SlnGen/SlnProject.cs [126:163]
public static SlnProject FromProject(Project project, IReadOnlyDictionary<string, Guid> customProjectTypeGuids, bool isMainProject = false)
{
if (project == null)
{
throw new ArgumentNullException(nameof(project));
}
if (customProjectTypeGuids == null)
{
throw new ArgumentNullException(nameof(customProjectTypeGuids));
}
if (!ShouldIncludeInSolution(project))
{
return null;
}
string fullPath = project.FullPath.ToFullPathInCorrectCase();
string name = project.GetPropertyValueOrDefault(MSBuildPropertyNames.SlnGenProjectName, Path.GetFileNameWithoutExtension(fullPath));
bool isUsingMicrosoftNETSdk = project.IsPropertyValueTrue(MSBuildPropertyNames.UsingMicrosoftNETSdk);
string projectFileExtension = Path.GetExtension(fullPath);
return new SlnProject
{
Configurations = GetConfigurations(project, projectFileExtension, isUsingMicrosoftNETSdk),
FullPath = fullPath,
IsDeployable = GetIsDeployable(project, projectFileExtension),
IsMainProject = isMainProject,
Name = name,
Platforms = GetPlatforms(project, projectFileExtension, isUsingMicrosoftNETSdk),
ProjectGuid = GetProjectGuid(project, isUsingMicrosoftNETSdk),
ProjectTypeGuid = GetProjectTypeGuid(projectFileExtension, isUsingMicrosoftNETSdk, customProjectTypeGuids),
SolutionFolder = project.GetPropertyValueOrDefault(MSBuildPropertyNames.SlnGenSolutionFolder, string.Empty),
};
}