I'm using BundleConfig.cs
in my project to reference the JS and CSS libraries. Here are some examples:
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Content/Scripts/bootstrap/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css/font-awesome").Include(
"~/Content/CSS/base/font-awesome.css"));
To use them, I do the following:
@Scripts.Render("~/bundles/bootstrap")
@Styles.Render("~/Content/css/font-awesome")
In the file BundleConfig.cs
, I also have the statement below:
BundleTable.EnableOptimizations = true;
The problem is that when I publish my site in IIS7, the application can not identify the files and add their reference.
The folder bundle
is created in the correct way, as shown below, but it seems that the site can not recognize them:
I'vealreadydonethetesttoaddthesettingsbelowinweb.config
,buttonoavail
<locationpath="bundles">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
Thank you!