|
|
|
@ -1,8 +1,10 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using JetBrains.Annotations; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.Extensions.FileProviders; |
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Microsoft.Extensions.Primitives; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
@ -91,9 +93,27 @@ namespace Volo.Abp.AspNetCore.VirtualFileSystem |
|
|
|
|
|
|
|
protected virtual IFileProvider CreateFileProvider() |
|
|
|
{ |
|
|
|
return new CompositeFileProvider( |
|
|
|
var fileProviders = new List<IFileProvider>() |
|
|
|
{ |
|
|
|
new PhysicalFileProvider(_hostingEnvironment.ContentRootPath), |
|
|
|
_virtualFileProvider |
|
|
|
}; |
|
|
|
|
|
|
|
if (_hostingEnvironment.IsDevelopment() && |
|
|
|
_hostingEnvironment.WebRootFileProvider is CompositeFileProvider compositeFileProvider) |
|
|
|
{ |
|
|
|
var staticWebAssetsFileProvider = compositeFileProvider |
|
|
|
.FileProviders |
|
|
|
.FirstOrDefault(f => f.GetType().Name.Equals("StaticWebAssetsFileProvider")); |
|
|
|
|
|
|
|
if (staticWebAssetsFileProvider != null) |
|
|
|
{ |
|
|
|
fileProviders.Add(staticWebAssetsFileProvider); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return new CompositeFileProvider( |
|
|
|
fileProviders |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
|