Set up IHostEnvironment
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace TheXamlGuy.TaskbarGroup.Core
|
||||
{
|
||||
public static class HostingHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder UseContentRoot(this IHostBuilder hostBuilder, string contentRoot, bool createDirectory)
|
||||
{
|
||||
if (!Directory.Exists(contentRoot) && createDirectory)
|
||||
{
|
||||
Directory.CreateDirectory(contentRoot);
|
||||
}
|
||||
|
||||
return hostBuilder.UseContentRoot(contentRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user