ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
753 stars 113 forks source link

Value cannot be null. (Parameter 'path') #225

Open enkelmedia opened 2 years ago

enkelmedia commented 2 years ago

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?