You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a new ASP.NET Core Web Application project targeting .NET Core 3.1 in VS2019 (and here's a repro project) and made no changes other than to add Ligershark.WebOptimizer.Core v3.0.250 and Ligershark.WebOptimizer.AutoPrefixer v7.1.8-beta and the relevant code in Startup.Confugure and Startup.ConfigureServices. If services.AddWebOptimizer(pipeline => pipeline.MinifyCssFiles().AutoPrefixCss()); is used, an exception (stack trace below) is thrown on requests to /css/site.css. If services.AddWebOptimizer(pipeline => pipeline.MinifyCssFiles()); is used, no exception is thrown.
System.MissingMethodException: Method not found: 'Void Microsoft.Extensions.Logging.Console.ConsoleLogger..ctor(System.String, System.Func`3<System.String,Microsoft.Extensions.Logging.LogLevel,Boolean>, Boolean)'.
at Microsoft.AspNetCore.NodeServices.NodeServicesOptions..ctor(IServiceProvider serviceProvider)
at Microsoft.Extensions.DependencyInjection.NodeServicesServiceCollectionExtensions.<>c__DisplayClass1_0.<AddNodeServices>b__0(IServiceProvider serviceProvider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at WebOptimizer.NodeServices.NodeProcessor.CreateNodeServicesInstance()
at WebOptimizer.NodeServices.NodeProcessor.get_NodeServices()
at WebOptimizer.AutoPrefixer.AutoPrefixerProcessor.ExecuteAsync(IAssetContext context)
at WebOptimizer.Asset.ExecuteAsync(HttpContext context, IWebOptimizerOptions options)
at WebOptimizer.AssetBuilder.BuildAsync(IAsset asset, HttpContext context, IWebOptimizerOptions options)
at WebOptimizer.AssetMiddleware.HandleAssetAsync(HttpContext context, IAsset asset, WebOptimizerOptions options)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
The text was updated successfully, but these errors were encountered:
After looking at this issue for some time, I finally came out with a solution. This package was designed for .NET Standard 2.0, not for .NET Core 3.0.
Just add <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.6" /> to your Startap.cs (inside <ItemGroup>) and re build. That will update the dependencies (the only .NET external dependence, actually), and will fix the issue @ligershark I can work in a PR to update all this to 3.0 if you want to.
@maxiostro That's a great idea. In the .csproj, let's make sure to udpate the version from 1.x to 3.0 and drop the -beta. That makes it more clear that the nuget package targets 3.0
I created a new ASP.NET Core Web Application project targeting .NET Core 3.1 in VS2019 (and here's a repro project) and made no changes other than to add Ligershark.WebOptimizer.Core v3.0.250 and Ligershark.WebOptimizer.AutoPrefixer v7.1.8-beta and the relevant code in Startup.Confugure and Startup.ConfigureServices. If
services.AddWebOptimizer(pipeline => pipeline.MinifyCssFiles().AutoPrefixCss());
is used, an exception (stack trace below) is thrown on requests to /css/site.css. Ifservices.AddWebOptimizer(pipeline => pipeline.MinifyCssFiles());
is used, no exception is thrown.The text was updated successfully, but these errors were encountered: