Fix launchSettings.json generation bug

This commit is contained in:
Wojtek Figat
2023-06-28 13:42:18 +02:00
parent 61bb41c878
commit fb6bc75e3a

View File

@@ -547,6 +547,7 @@ namespace Flax.Build.Projects.VisualStudio
if (project.Type == TargetType.DotNetCore) if (project.Type == TargetType.DotNetCore)
{ {
var path = Path.Combine(Path.GetDirectoryName(project.Path), "Properties/launchSettings.json"); var path = Path.Combine(Path.GetDirectoryName(project.Path), "Properties/launchSettings.json");
path = Utilities.NormalizePath(path);
if (profiles.ContainsKey(path)) if (profiles.ContainsKey(path))
profile.AppendLine(","); profile.AppendLine(",");
profile.AppendLine($" \"{project.BaseName}\": {{"); profile.AppendLine($" \"{project.BaseName}\": {{");
@@ -568,6 +569,7 @@ namespace Flax.Build.Projects.VisualStudio
var folder = Path.GetDirectoryName(e.Key); var folder = Path.GetDirectoryName(e.Key);
if (!Directory.Exists(folder)) if (!Directory.Exists(folder))
Directory.CreateDirectory(folder); Directory.CreateDirectory(folder);
profile.Clear();
profile.AppendLine("{"); profile.AppendLine("{");
profile.AppendLine(" \"profiles\": {"); profile.AppendLine(" \"profiles\": {");
profile.AppendLine(e.Value); profile.AppendLine(e.Value);