Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The CSS and Script bundling should work regardless if .NET is running 4.0 or 4.5. I am running .NET 4.0 and it works fine for me. However in order to get the minification and bundling behavior to work your web.config must be set to not be running in debug mode.</p> <pre><code>&lt;compilation debug="false" targetFramework="4.0"&gt; </code></pre> <p>Take this bundle for jQuery UI example in the _Layout.cshtml file.</p> <pre><code>@Styles.Render("~/Content/themes/base/css") </code></pre> <p>If I run with <code>debug="true"</code> I get the following HTML.</p> <pre><code>&lt;link href="/Content/themes/base/jquery.ui.core.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.resizable.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.selectable.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.accordion.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.autocomplete.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.button.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.dialog.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.slider.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.tabs.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.datepicker.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.progressbar.css" rel="stylesheet"/&gt; &lt;link href="/Content/themes/base/jquery.ui.theme.css" rel="stylesheet"/&gt; </code></pre> <p>But if I run with <code>debug="false"</code>. I'll get this instead.</p> <pre><code>&lt;link href="/Content/themes/base/css?v=myqT7npwmF2ABsuSaHqt8SCvK8UFWpRv7T4M8r3kiK01" rel="stylesheet"/&gt; </code></pre> <p>This is a feature so you can easily debug problems with your Script and CSS files. I'm using the MVC4 RTM.</p> <p>If you think it might be an MVC dependency problem, I'd recommend going into Nuget and removing all of your MVC related packages, and then search for the <code>Microsoft.AspNet.Mvc</code> package and install it. I'm using the most recent version and it's coming up as v.4.0.20710.0. That should grab all the dependencies you need.</p> <p>Also if you used to be using MVC3 and are now trying to use MVC4 you'll want to go into your web.config(s) and update their references to point to the 4.0 version of MVC. If you're not sure, you can always create a fresh MVC4 app and copy the web.config from there. Don't forget the web.config in your Views/Areas folders if you do.</p> <p><strong>UPDATE:</strong> I've found that what you need to have is the Nuget package <code>Microsoft.AspNet.Web.Optimization</code> installed in your project. It's included by default in an MVC4 RTM app regardless if you specify the target framework as 4.5 or 4.0. This is the namespace that the bundling classes are included in, and doesn't appear to be dependent on the framework. I've deployed to a server that does not have 4.5 installed and it still works as expected for me. Just make sure the DLL gets deployed with the rest of your app.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload