-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BundleTagHelper is not compatible with ASP.NET Core 2.2 (FileVersionProvider no longer exists) #403
Comments
So currently, I install the package, produce bundles, then uninstall it. |
Solved with 2.9.406, @NicolasDorier is the author of fix. https://www.nuget.org/packages/BundlerMinifier.TagHelpers/2.9.406 Let me know if you run into any problems with using new version. |
A better long term solution is to have a package with both .net 2.1 and .net 2.2 versions where the 2.2 just resolve IFileVersionProvider from the ctor. |
The BundleTagHelper is not compatible with ASP.NET Core 2.2. If the AppendVersion option is enabled, it attempts to create an instance of the FileVersionProvider class. In 2.2, this is now dependency injected as IFileVersionProvider, with the original class no longer existing in that form (see aspnet/Mvc#6371). This causes runtime failures when the tag helper attempts to version the bundles.
To fix the tag helper, it should just be a case of injecting an IFileVersionProvider and using that, however I'm wary of submitting a PR as the change will break compatibility with ASP.NET Core 2.1 and earlier.
For anyone affected by this, a short-term workaround is to turn off the version appending functionality globally. To do this, set up an instance of BundleOptions in your application to be dependency injected into the tag helper so that the default settings are never used, and set AppendVersion to false in that instance (as well as setting the other options appropriately).
The text was updated successfully, but these errors were encountered: