Questions tagged [asp.net-optimization]

Questions related to the ASP.NET Microsoft.AspNet.Web.Optimization nuGet package (System.Web.Optimization namespace), which supports bundling and minification of javascript and css files.

Project homepage: https://archive.codeplex.com/?p=aspnetoptimization

The Web optimization framework is installed via NuGet at https://nuget.org/packages/Microsoft.AspNet.Web.Optimization

Description:

The ASP.NET Web optimization framework provides services to improve the performance of your ASP.NET Web applications. Current services provided by the framework include:

bundling - combining multiple scripts or style resources together into a single resource, and thereby requiring browsers to make fewer HTTP requests

minification - making scripts or styles smaller using techniques such variable name shortening, white space elimination, etc.

Additionally, the framework has multiple extensibility points, enabling you to add new services over time.

174 questions
19
votes
4 answers

Runtime dynamic bundling and minifying in MVC 4

I was wondering if anybody can help me with bundling and minifying using the new optimization namespace shipped with MVC 4. I have a Multitenant-application in which I want to decide which js files should be loaded based on settings per user. One…
18
votes
3 answers

How to resolve Antlr3 dependency hell

I have a asp.net MVC 4 project with MEF and RavenBD. When the project loads it throws this exception : Could not load file or assembly Antlr3.Runtime.dll I have found that both RavenDB and WebGrease (installed with MVC 4) use Antlr3. But WebGrease…
18
votes
3 answers

Why is MVC4 @Styles.Render() not behaving as expected in debug mode

I am implementing the bundling and minification support in MVC4 and setting it up so it can compile my Bootstrap .less files automatically for me. I have the following code in my BundleConfig.cs file public class BundleConfig { public static…
PlTaylor
  • 7,345
  • 11
  • 52
  • 94
16
votes
10 answers

How to disable Javascript/CSS minification in ASP.NET MVC 4 Beta

I am just trying out ASP.NET MVC 4 but I can't figure out how to disable Javascript/CSS minification feature. Especially for development environment this will help greatly on debugging. I would imagine it would be a switch in web.config but since…
Jeff
  • 13,079
  • 23
  • 71
  • 102
16
votes
2 answers

Bundle file location in ASP.NET MVC

Where are the generated bundle files placed? bundles.Add(new ScriptBundle("~/bundles/jqueryall") .IncludeDirectory("~/scripts/", "*.js", true)
16
votes
2 answers

MVC4 Bundle minification doesn't work with javascript reserved words

Using the latest version of MVC4 I can't minify javascript when it contains reserved words as key names! See the error below with the valid javascript that should have been minified. Does anyone know how to fix this short of rewriting the javascript…
15
votes
1 answer

Can you pre-cache ASP.NET Bundles?

Every time I deploy an MVC web application my server has to re-cache all js and css bundles. Because of this it can take several seconds for the first view to render after deploying. Is there a way to pre-cache bundles? After all, the files are…
Mark Rucker
  • 6,952
  • 4
  • 39
  • 65
15
votes
1 answer

MVC4 StyleBundle doesn't render the bundle in the correct order

I'm trying to render a bundle of css files, but the output is in wrong order. I've tried the solution @ MVC4 Beta Minification and Bundling: Ordering files and debugging in browser , but it didn't help. Here is the bundle: bundles.Add(new…
M. Mennan Kara
  • 10,072
  • 2
  • 35
  • 39
15
votes
1 answer

Is there any way to have a file extension in a bundle name?

I would like to have define a bundle like this: bundles.Add( new StyleBundle("~/style.css").Include( //... )); If the bundle name is just "~/style" this works, but with the file extension it always returns a 404. I suspect the server…
15
votes
3 answers

Where can I find the source for System.Web.Optimization?

I am trying to figure out why when I create a scriptbundle that is referencing files that are in an IIS VirtualDirectory under my main site's application folder, why it won't output anything. I found this post: Why does ResolveBundleUrl not work for…
happyfirst
  • 1,033
  • 1
  • 13
  • 27
14
votes
2 answers

New ASP.NET Bundling Features - How can i programmatically refresh a certain bundle?

I'm mucking around with the new ASP.NET bundling features (using the System.Web.Optmization 1.0.0-beta pre-release) in my ASP.NET MVC 3 web application. Works great. However, we have certain dynamic CSS/JS which is stored in the database. I want to…
RPM1984
  • 72,246
  • 58
  • 225
  • 350
14
votes
4 answers

MVC4 Beta Minification and Bundling: Ordering files and debugging in browser

I've started using bundling and minification included with the MVC4 Beta. I'm running into a few issues with it: For one thing, if I use the classic