WebOptimizer
WebOptimizer copied to clipboard
Value cannot be null. (Parameter 'path')
Plattform: .NET 6, Windows
I've added WebOptimizer according to the guidelines, something like this:
public void ConfigureServices(IServiceCollection services)
{
services.AddWebOptimizer(
pipeline =>
{
pipeline.AddCssBundle("/test.css", "style_css/layout.css", "style_css/page.css");
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseWebOptimizer();
....
}
But when requesting /site.css I get the following error:
An unhandled exception occurred while processing the request.
ArgumentNullException: Value cannot be null. (Parameter 'path')
System.IO.Path.GetFullPath(string path)
Stack Query Cookies Headers Routing
ArgumentNullException: Value cannot be null. (Parameter 'path')
System.IO.Path.GetFullPath(string path)
WebOptimizer.Asset.ExpandGlobs(IAsset asset, IHostingEnvironment env)
WebOptimizer.Asset.ExecuteAsync(HttpContext context, IWebOptimizerOptions options)
WebOptimizer.AssetMiddleware.HandleAssetAsync(HttpContext context, IAsset asset, WebOptimizerOptions options)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
What I'm I doing wrong here or is this a bug?