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
2
votes
1 answer

Catching and logging MVC4 message about "Minification failed. Returning unminified contents"

There are a number of questions on StackOverflow that talk about getting the Minification failed. Returning unminified contents error from the MVC4 minification. I'd like to know if there is a way to be notified about this error when it happens and…
slolife
  • 19,520
  • 20
  • 78
  • 121
2
votes
2 answers

How to add .min and .debug files in a bundle effectively

I want to take advantage of .min and .debug versions of js and css files. Consider this bundle for example: bundles.Add( new ScriptBundle("~/scripts/vendor") .Include("~/scripts/jquery-{version}.js") …
mehrandvd
  • 8,806
  • 12
  • 64
  • 111
2
votes
1 answer

Script Bundling in WebForms with Virtual Directories

We have a separate "Framework" project for shared controls, javascript, etc. that is used by this and other projects. The Framework project is included in our solution, and we made a virtual directory for it with IIS so we can still make relative…
2
votes
1 answer

Ignoring a single file in the bundle

Set up my bundles as follows: bundles.UseCdn = true; var scriptJquery = new ScriptBundle(Bundles.Scripts.Jquery, "//code.jquery.com/jquery-1.9.1.js") { CdnFallbackExpression = "window.jQuery", } …
ridermansb
  • 10,779
  • 24
  • 115
  • 226
2
votes
4 answers

Asp.net Bundle not render files .min

I've read and done the steps in this, this and this post! Still can not use the Asp.net Bundles! In Global.asax.cs BundleConfig.RegisterBundles(BundleTable.Bundles, Server); and ... public static void RegisterBundles(BundleCollection bundles,…
ridermansb
  • 10,779
  • 24
  • 115
  • 226
2
votes
1 answer

Using Bundling (from Systelm.Web.Optimization) in ASP.Net WebForms causes issue

I am trying to put in some optimization into my application by using BundlesCollection in my ASP.Net 4.0 application. My style bundle contains 6 css files. The files are included into a master page. If I remove the CSS files from master page and…
TheVillageIdiot
  • 40,053
  • 20
  • 133
  • 188
2
votes
1 answer

Workaround for Bundling under Virtual Path Providers

I found that under ASP.NET MVC 4 you can't define a bundle of Javascripts or CSSs if their virtual path is managed by a VirtualPathProvider. I mean, if directory "~/Static/" is mapped to a VPP you can't…
usr-local-ΕΨΗΕΛΩΝ
  • 26,101
  • 30
  • 154
  • 305
2
votes
1 answer

Using ASP.NET Javascript Bundles from the controller

I realise this breaks the MVC pattern, but there is a viable reason for doing it this way in an application I am currently building :) What I am trying to do is output a JavaScript bundle directly from the Controller rather than via a link via a…
2
votes
3 answers

ScriptBundle dependencies

I'm having difficulties getting the ScriptBundle to work properly (if this is supposed to work at all). What I'm trying to do is add another bundle (jQuery) as a dependency to my bundle, like so: bundles.Add(new ScriptBundle("~/js/myscripts") …
Asbjørn Ulsberg
  • 8,721
  • 3
  • 45
  • 61
2
votes
1 answer

ASP.NET MVC 4 Bundling and Minification: wrong paths in Debug Mode with Url Rewrite

I want to use the ASP.NET MVC 4 Bundling and Minification feature, please assume that we run the debug mode so nothing is bundled, but each reference is simply rendered to single tags. Locally everything works fine: Example public static void…
thmshd
  • 5,729
  • 3
  • 39
  • 67
2
votes
2 answers

Trigger the bundle inclusion from partial or editor templates in ASP.NET MVC 4

I'm building a framework on top of ASP.NET MVC 4. I like the new bundling feature in MVC4 but I'm running into an issue and I'm not sure if the new bundling features address this scenario. My layout view is rendering it's script bundles at the…
Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346
2
votes
1 answer

Upgrading Web Optimization Framework to RTM

When I upgrade from Microsoft ASP.NET Web Optimization Framework 1.0.0-beta2 to Microsoft ASP.NET Web Optimization Framework 1.0.0 via nuget some of my scripts are no longer rendered to the page. This seems pretty strange and im wondering if I need…
undefined
  • 33,537
  • 22
  • 129
  • 198
2
votes
1 answer

Debugging MVC4 bundling with RTM

So I finished developing a new mvc4 application with the rtm bits. I deployed to a prod server and everything is working fine apart from the styling. Something is wrong with the bundle, I assume its an ordering problem or some file that's not…
Diver Dan
  • 9,953
  • 22
  • 95
  • 166
2
votes
1 answer

How to include JavaScript and CSS from custom directories in ASP.NET MVC 4, .net 4.5?

Considering this folder structure: Content style1.css style2.css CssFolder1 style3.css style4.css style5.css style6.css In the application, I want to include style1.css, style2.css, style3.css and…
2
votes
2 answers

asp.net mvc script bundle adding all the files

When you add a script bundle and have something like: bundles.Add(new ScriptBundle("~/bundles/base.scripts").Include( "~/Scripts/jquery-1*")); It loads up the raw Jquery version and the minified version. Those files are…
Jacques
  • 6,936
  • 8
  • 43
  • 102