Skip to content

Commit 99570d0

Browse files
- Issue oleg-shilo#190: NuGet errors with > 3.28
1 parent abcd978 commit 99570d0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Source/NuGet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static PackageInfo FindPackage(string name, string version)
228228

229229
.OrderByDescending(x => x.Version)
230230
.Where(x => x != null)
231-
.FirstOrDefault(x => x.Name == name && (version.IsEmpty() || version == x.Version));
231+
.FirstOrDefault(x => x.Name.IsSameAs(name, true) && (version.IsEmpty() || version == x.Version));
232232

233233
// nuspec based algorithm from cs-script.core
234234
// return Directory.GetDirectories(NuGetCache)

Source/extensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ public static Exception CaptureExceptionDispatchInfo(this Exception ex)
214214
return ex;
215215
}
216216

217+
public static bool IsSameAs(this string text1, string text2, bool ignoreCase = false)
218+
=> string.Compare(text1, text2, ignoreCase) == 0;
219+
217220
public static List<string> AddIfNotThere(this List<string> items, string item, string section)
218221
{
219222
if (item != null && item != "")

0 commit comments

Comments
 (0)