user1740381
user1740381

Reputation: 2199

Issue with Bundling and Minification

I am trying to use the asp.net bundling and minification feature. The issue is when i am including the jquery ui custom script in the bundle than the script is not rendering in my layout page. The code is:

bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
         "~/Scripts/jquery-ui-{version}.custom.js"));

bundles.Add(new StyleBundle("~/content/jquery").Include(
            "~/Content/jquery-ui-{version}.custom.css"));

The above both CSS and script is not including. What am I doing wrong here ?

Upvotes: 2

Views: 478

Answers (2)

Brian S
Brian S

Reputation: 5785

Once you've created the bundles, you'll need to add them to your HTML somewhere. Usually in the _Layout.cshtml, you'll need a line like this:

@Scripts.Render("~/bundles/jqueryui")

Upvotes: 2

G Mathew
G Mathew

Reputation: 1

One more option to debug the issue is installing the fiddler and checking the files downloaded while making the request for the webpage Just click on the missing file name in the fiddler and check what is the content returned. In my case it returned the error message Could not load file or assembly WebGrease. I have removed and added the reference and now the script files are rendered.

Upvotes: 0

Related Questions