Skip to content

Fix root directory not being considered by UseSolutionRelativeContentRoot() #34079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Hosting/TestHost/src/WebHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static IWebHostBuilder ConfigureTestServices(this IWebHostBuilder webHost
throw new ArgumentNullException(nameof(servicesConfiguration));
}

if (webHostBuilder.GetType().Name.Equals("GenericWebHostBuilder"))
if (webHostBuilder.GetType().Name.Equals("GenericWebHostBuilder", StringComparison.Ordinal))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow this is jank.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for drawing attention to it 😆

{
// Generic host doesn't need to do anything special here since there's only one container.
webHostBuilder.ConfigureServices(servicesConfiguration);
Expand Down Expand Up @@ -184,7 +184,7 @@ public static IWebHostBuilder UseSolutionRelativeContentRoot(

directoryInfo = directoryInfo.Parent;
}
while (directoryInfo!.Parent != null);
while (directoryInfo is not null);

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