When setting up WebOptimizer in Startup using the ServiceExtensions methods, only one of the methods sets the static properties CssBundlingSettings and CodeBundlingSettings.
These properties are required in order for the MinifyOnDemand tag helper to work and if you don't use the AddWebOptimizer() method that takes in a CssBundlingSettings and a CodeBundlingSettings and they try to use MinifyOnDemandTagHelper, the tag will throw a null reference exception.
When setting up WebOptimizer in Startup using the ServiceExtensions methods, only one of the methods sets the static properties CssBundlingSettings and CodeBundlingSettings.
These properties are required in order for the MinifyOnDemand tag helper to work and if you don't use the AddWebOptimizer() method that takes in a CssBundlingSettings and a CodeBundlingSettings and they try to use MinifyOnDemandTagHelper, the tag will throw a null reference exception.