The System.Web.Optimization namespace includes classes that support Content Delivery Networks (CDN) and the process of optimizing JavaScript and cascading style sheet (CSS) files in a website to reduce file size and improve page performance. The classes in this namespace enable developers to carry out bundling and minification tasks to optimize their JavaScript and CSS files.
Questions tagged [system.web.optimization]
81 questions
1
vote
2 answers
System.Web.Optimization bundling css js caching
I am using System.Web.Optimization to bundle css and js files. So from what I understand System.Web.Optimization is caching js and css bundle on client side and that works fine. I checked my calls on fiddler first time when page loads for js and css…

Alkingson
- 13
- 3
1
vote
1 answer
Unit tests: mock for BundleTable.Bundles
I am trying to do some unit tests for a custom helper created to render the scripts included in a bundle.
My problem is I need to create a mock for BundleTable.Bundles object, but I didn't find any relevant way how I can achieve this.
My method…

Ovi O
- 43
- 6
1
vote
0 answers
Prevent Microsoft Bundling from adding "jquery" Files to the top
I have been running System.Web.Optimization successfully for several months and all has been great.
I am currently adding CKEditor to my website and I ran into an issue.
Background:
CKEditor has it's own ckeditor.js file. They also include a jquery…

RoLYroLLs
- 3,113
- 4
- 38
- 57
1
vote
1 answer
System.Web.Optimization bundle retrieving from cache cost a lot of time
I faced a strange issue, while having the second load of the page, bundle must be retrieved from Cache, right? But what I see is that some long operations is performed on each request. Perhaps someone knows how to figure this out? Where does the…

Alex Klunniy
- 125
- 1
- 8
1
vote
1 answer
Bundles not appearing after website publish
I'm still kind of new with ASP.NET MVC, so please excuse me if I'm missing something obvious. I recently just published a site through Visual Studio to our development server to see how everything was working. When I browse to the dev site, none of…

Chiggins
- 8,197
- 22
- 56
- 81
1
vote
1 answer
Unit Testing an ASP.NET MVC Action Which Accesses the Bundles
Here's the code in my action method:
var bundleUrl = Scripts.Url("~/Scripts/MyBundle");
When i try and unit test this action method, i get the following error/stack trace:
System.ArgumentNullException
Value cannot be null.
Parameter name:…

RPM1984
- 72,246
- 58
- 225
- 350
1
vote
0 answers
Why doesn't a div background image work with minified CSS?
I use MVC4 and minifying my CSS files, but a div tag that have a background image isn't showing the image in release mode. When I inspect the page with firebug, it says "Failed to load image..."
It works in debug mode, but not in release mode.
What…

motevalizadeh
- 5,244
- 14
- 61
- 108
1
vote
1 answer
Adding System.Web.Optimization to VS2012 Project
I downloaded VS2012 Express for Web today just to mess with it. Did a tutorial that was on the ASP.Net website. Then I decided to start my own project and start it with an Empty site. This way I can see how/why some things were added and what…

XstreamINsanity
- 4,176
- 10
- 46
- 59
1
vote
1 answer
Does mvc 4 bundling require a number on the js file in order to use the -{version}?
I've been struggling to get my bundle to resolve my .js files at runtime in release mode i.e. with the .
After some hours I chanced changing the name of my .js files to file names with a number.…

learnerplates
- 4,257
- 5
- 33
- 42
1
vote
1 answer
JavaScript Error in Production but not Dev/Test (Bundling doesn't handle Linux style line endings)
I have a website running on MVC4 using the following javascript libraries.
jQuery, jQueryValidate, Bootstrap, FineUploader, MaskedInput, Knockout and Modernizr. I also have my app specific javascript in there as well. They are all loaded using the…

Nick Albrecht
- 16,607
- 10
- 66
- 101
0
votes
1 answer
Create ThemeBuilder for dynamic themes
I'm working on a multi-tenant app that has a Theme builder based on their defined settings like theme color etc..
I used this approach http://bundletransformer-theme-builder.azurewebsites.net/ for bootstrap 3. However since we have upgraded to…

rpmansion
- 1,964
- 1
- 9
- 26
0
votes
0 answers
Web page load issue intermittently and no html/js requests triggered except the bundles from Asp.net MVC
We have an asp.net MVC application and facing an issue for a specific web page that fails to load initially for few times but loads subsequently.
I tried looking in the network tab for network activity and identified that whenever there is an issue…

Rohit Garg
- 493
- 2
- 12
0
votes
1 answer
AngularJS angular-ui-router.min.js breaks app when BundleTable.EnableOptimizations = true
I have a very simple project in AngularJS 1.7.5 (and tried 6).
I am using system.web.optimization to do my bundling.
When running the project with optimization turned off it works fine.
When I turn on optimizations I get errors presumably from…

Mike Mason
- 3
- 1
0
votes
1 answer
ASP.NET and Visual Studio doesn't send scripts / style bundles
I keep having a re-occuring problem with my code in MVC where when my page loads and I right click to view source, it doesnt have any of my scripts or css in there.
In my .csHTML, it is listed as…
user7085229
0
votes
1 answer
How can I use System.Web.Optimization (.net js bundler) with amd modules?
Now I am working with the project using System.Web.Optimization as js bundler.
How can I use amd modules with this bundler?
define('myModule', function(myModule){})
Now I am obviously getting define is not defined error.
Webpack and r.js can…

Daydreaming Duck
- 2,110
- 3
- 18
- 25