HI Team,
I'm trying to to bundling CSS files after minification. My application is ASP.net Core 4.5 not MVC. I have created bungleconfig class file and written below code
public class bundleconfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/bundles/css").Include(
"~/Content/bootstrap.min.css",
"~/Content/main.min.css",
"~/Content/theme.min.css",
"~/Content/bootstrap-select.min.css",
"~/Content/bootstrap-slider.min.css",
"~/Content/bootstrap-theme.min.css",
"~/Content/bootstrap-treeview.min.css",
"~/Content/bootstrap-datetimepicker.min.css",
"~/Content/buttons.dataTables.min.css",
"~/Content/dataTables.bootstrap.min.css",
"~/Content/jquery-ui.min.css",
"~/Content/bootstrap-treeview.min.css"
)
);
BundleTable.EnableOptimizations = true;
}
}
in Main.Maste I added below code in head tag
<%: System.Web.Optimization.Styles.Render("~/bundles/css") %>
After running code MY css is not bundled and nothing applied as well. Getting error
Refused to apply style from <URL> because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Please help
Thanks In advance