Skip to content

Commit 66a04c4

Browse files
committed
Fix closing tag check.
1 parent 85befa1 commit 66a04c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/BenchmarkDotNet/Toolchains/CsProj/CsProjGenerator.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,16 @@ private static void AppendPackageReference(string line, StringBuilder stringBuil
150150
do
151151
{
152152
stringBuilder.AppendLine(line);
153+
line = RemoveAllWhiteSpace(line);
153154
}
154-
while (!line.EndsWith("\" />") && !line.EndsWith("</PackageReference>") && (line = streamReader.ReadLine()) != null);
155+
while (!line.EndsWith("/>") && !line.EndsWith("</PackageReference>") && (line = streamReader.ReadLine()) != null);
155156
}
156157

158+
private static string RemoveAllWhiteSpace(string value)
159+
=> new string(value.ToCharArray()
160+
.Where(c => !char.IsWhiteSpace(c))
161+
.ToArray());
162+
157163
/// <summary>
158164
/// returns a path to the project file which defines the benchmarks
159165
/// </summary>

0 commit comments

Comments
 (0)