Skip to content

Commit d804e5d

Browse files
Fix root directory not being considered by UseSolutionRelativeContentRoot() (#34079)
* Fix root directory not being considered Fix the root directory of a drive not being considered to find the solution. Addresses #33363. * Resolve CA1309 warning Resolve CA1309 warning be specifying StringComparison.Ordinal.
1 parent 2c553fd commit d804e5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Hosting/TestHost/src/WebHostBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static IWebHostBuilder ConfigureTestServices(this IWebHostBuilder webHost
8686
throw new ArgumentNullException(nameof(servicesConfiguration));
8787
}
8888

89-
if (webHostBuilder.GetType().Name.Equals("GenericWebHostBuilder"))
89+
if (webHostBuilder.GetType().Name.Equals("GenericWebHostBuilder", StringComparison.Ordinal))
9090
{
9191
// Generic host doesn't need to do anything special here since there's only one container.
9292
webHostBuilder.ConfigureServices(servicesConfiguration);
@@ -184,7 +184,7 @@ public static IWebHostBuilder UseSolutionRelativeContentRoot(
184184

185185
directoryInfo = directoryInfo.Parent;
186186
}
187-
while (directoryInfo!.Parent != null);
187+
while (directoryInfo is not null);
188188

189189
throw new InvalidOperationException($"Solution root could not be located using application root {applicationBasePath}.");
190190
}

0 commit comments

Comments
 (0)