Open DavidJoyal opened 5 years ago
Any chance you correct this @madskristensen ?
Also pinged @hellfirehd because I think he was the one who added this fonctionality?
That looks reasonable. Send a pull request and it will probably get accepted sooner. I’m running off a fork because I think this project is abandoned/dead.
Alright, I just did that. I hope I did it right
Thank you
Is it possible to approve this merge? We're using the Azure run from package feature, that creates a readonly wwwroot content directory. All the first call to WebOptimizer fail (disk caching is disabled) because it's not allowed to create the directory.
Can someone please approve this merge ?
Done
Is there going to be a new release with this fix... the latest public package still contains the bug.
... or do I need to fork this project coz it's dead
When I tried to disabled the cache to disk, by adding this to my appsettings.json
"webOptimizer": { "enableDiskCache": false }
the class AssetResponse still try to save it on the disk.I think the error come from the class AssetBuilder in the function BuildAsync on the line:
await _assetResponseCache.AddAsync(asset.Route, cacheKey, response).ConfigureAwait(false);
I think it should be
if (options.EnableDiskCache == true) { await _assetResponseCache.AddAsync(asset.Route, cacheKey, response).ConfigureAwait(false); }
Any chance you can add this line or correct this bug in an other way?
In my case, the css and js return a 500 error because my user does not have the right to create the folder and the file
Here is the error (I removed the path on my disk)
System.UnauthorizedAccessException: Access to the path '**custom path**' is denied. at System.IO.FileSystem.CreateDirectory(String fullPath) at System.IO.Directory.CreateDirectory(String path) at WebOptimizer.AssetResponseStore.AddAsync(String bucket, String cachekey, AssetResponse assetResponse) at WebOptimizer.AssetBuilder.BuildAsync(IAsset asset, HttpContext context, IWebOptimizerOptions options) at WebOptimizer.AssetMiddleware.HandleAssetAsync(HttpContext context, IAsset asset, WebOptimizerOptions options) at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext]