Fix Visual Studio project GUIDs getting randomized during regeneration
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Flax.Build.Projects.VisualStudio
|
||||
public override TargetType? Type => TargetType.DotNet;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void GenerateProject(Project project)
|
||||
public override void GenerateProject(Project project, string solutionPath)
|
||||
{
|
||||
var csProjectFileContent = new StringBuilder();
|
||||
|
||||
@@ -49,6 +49,11 @@ namespace Flax.Build.Projects.VisualStudio
|
||||
if (vsProject.CSharp.UseFlaxVS && VisualStudioInstance.HasFlaxVS)
|
||||
projectTypes = ProjectTypeGuids.ToOption(ProjectTypeGuids.FlaxVS) + ';' + projectTypes;
|
||||
|
||||
// Try to reuse the existing project guid from solution file
|
||||
vsProject.ProjectGuid = GetProjectGuid(solutionPath, vsProject.Name);
|
||||
if (vsProject.ProjectGuid == Guid.Empty)
|
||||
vsProject.ProjectGuid = Guid.NewGuid();
|
||||
|
||||
// Header
|
||||
|
||||
csProjectFileContent.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||
|
||||
Reference in New Issue
Block a user