2
I’m using the BundleConfig.cs
in my project to reference the JS and CSS libraries. Below are 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 it as follows:
@Scripts.Render("~/bundles/bootstrap")
@Styles.Render("~/Content/css/font-awesome")
In the archive BundleConfig.cs
, also have the instruction below:
BundleTable.EnableOptimizations = true;
The problem is that when I publish my site on IIS7, the application cannot identify the files and add their reference.
The briefcase bundle
is created in the correct way, as image below, but it seems that the site can not recognize them:
I have already done the test to add the settings below on web.config
, but without success
<location path="bundles">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
Thank you!
The time this happened here, after a lot of effort we found that the problem occurred because my boss merged the Scripts folder when deploying (instead of deleting and pasting the new version). The folders that remained there of residue conflicted with the names of Bundles. It doesn’t seem to be your case, I’m just commenting here for the next ones who consult this question.
– Eduardo Moreira