Add an overload that takes the application base path explicitly
This commit is contained in:
Родитель
e892ed8bbd
Коммит
fc613303ed
|
@ -53,13 +53,25 @@ namespace Microsoft.AspNetCore.TestHost
|
|||
this IWebHostBuilder builder,
|
||||
string solutionRelativePath,
|
||||
string solutionName = "*.sln")
|
||||
{
|
||||
return builder.UseSolutionRelativeContentRoot(solutionRelativePath, AppContext.BaseDirectory, solutionName);
|
||||
}
|
||||
|
||||
public static IWebHostBuilder UseSolutionRelativeContentRoot(
|
||||
this IWebHostBuilder builder,
|
||||
string solutionRelativePath,
|
||||
string applicationBasePath,
|
||||
string solutionName = "*.sln")
|
||||
{
|
||||
if (solutionRelativePath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(solutionRelativePath));
|
||||
}
|
||||
|
||||
var applicationBasePath = AppContext.BaseDirectory;
|
||||
if (applicationBasePath == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(applicationBasePath));
|
||||
}
|
||||
|
||||
var directoryInfo = new DirectoryInfo(applicationBasePath);
|
||||
do
|
||||
|
|
Загрузка…
Ссылка в новой задаче