asp.net-optimization

Compression of bundles created by asp.net bundling using 'System.Web.Optimization'?

末鹿安然 提交于 2021-02-07 16:46:26
问题 I have created bundles in my asp.net web solution by using the new bundling and minification package by MS. Everything is properly bundled and minified (used global.asax way) but when I deploy on IIS the bundle is not getting compressed (gzip) , I don't want to enable dynamic compression (as it will compress all dynamic content), just want to compress bundles only. What to do ? What is the mime type of a bundled output, like for this bundle named 'Jquery' here : "http://Myhost/MySite/JQuery?v

Compression of bundles created by asp.net bundling using 'System.Web.Optimization'?

我的梦境 提交于 2021-02-07 16:42:47
问题 I have created bundles in my asp.net web solution by using the new bundling and minification package by MS. Everything is properly bundled and minified (used global.asax way) but when I deploy on IIS the bundle is not getting compressed (gzip) , I don't want to enable dynamic compression (as it will compress all dynamic content), just want to compress bundles only. What to do ? What is the mime type of a bundled output, like for this bundle named 'Jquery' here : "http://Myhost/MySite/JQuery?v

Compression of bundles created by asp.net bundling using 'System.Web.Optimization'?

早过忘川 提交于 2021-02-07 16:41:48
问题 I have created bundles in my asp.net web solution by using the new bundling and minification package by MS. Everything is properly bundled and minified (used global.asax way) but when I deploy on IIS the bundle is not getting compressed (gzip) , I don't want to enable dynamic compression (as it will compress all dynamic content), just want to compress bundles only. What to do ? What is the mime type of a bundled output, like for this bundle named 'Jquery' here : "http://Myhost/MySite/JQuery?v

Compression of bundles created by asp.net bundling using 'System.Web.Optimization'?

不打扰是莪最后的温柔 提交于 2021-02-07 16:41:44
问题 I have created bundles in my asp.net web solution by using the new bundling and minification package by MS. Everything is properly bundled and minified (used global.asax way) but when I deploy on IIS the bundle is not getting compressed (gzip) , I don't want to enable dynamic compression (as it will compress all dynamic content), just want to compress bundles only. What to do ? What is the mime type of a bundled output, like for this bundle named 'Jquery' here : "http://Myhost/MySite/JQuery?v

Could not load file or assembly 'WebGrease' one of its dependencies. The located assembly's manifest definition does not match the assembly reference

拥有回忆 提交于 2019-12-30 05:44:28
问题 This issue has many solutions, please read all answers below, they might help you solve your problem too. If you find a new way to solve this, please document in your answer I am trying to add System.Web.Optimization to my ASP.NET Web Forms solution. I added Microsoft ASP.NET Web Optimization Framework through NuGet Packages. It added Microsoft.Web.Infrastracture and WebGrease (1.5.2) to the references. However, when I run <%= System.Web.Optimization.Scripts.Render("~/bundles/js")%> I get

Is it possible to unit test BundleConfig in MVC4?

瘦欲@ 提交于 2019-12-29 08:30:11
问题 As far as I can tell, the answer is no. The issue I'm seeing comes from the Include(params string[]) method in the System.Web.Optimization.Bundle class. Internally this invokes System.Web.Optimization.IncludeDirectory(string, string, bool) , which in turn uses this code: DirectoryInfo directoryInfo = new DirectoryInfo( HttpContext.Current.Server.MapPath(directoryVirtualPath)); While it is possible to set HttpContext.Current during a unit test, I can't figure out how to make its .Server

ASP.NET Bundling - Bundle not updating after included file has changed (returns 304 not modified)

假如想象 提交于 2019-12-28 03:31:06
问题 I am trying out ASP.NET Bundling with ASP.NET MVC 4 application. The situation is that I want to make a CDN style service, which has JS and CSS files to which you can address from other sites with this type address: http://www.mycdn.com/scripts/plugin/js, which bundles and minifies all included .js files. My bundle config for one file looks like this: bundles.Add(new ScriptBundle("~/Scripts/plugin/pluginjs").Include("~/Scripts/plugin/jquery.plugin.js")); However, when I do this, the bundles

How can I still run a custom IBundleTransform when EnableOptimization is off in ASP.NET?

徘徊边缘 提交于 2019-12-23 19:07:48
问题 First the background - I'm using Handlebars for templating HTML and I want to make use of the bundling and caching capabilities of ASP.NET Bundling to deliver the templates to the client. To that end I've created my own Bundle subclass and an implementation of IBundleTransform that does some necessary conversion of my templates. In particular I: add the templates to visual studio as HTML but embed the template in a <script type='text/x-handlebars-template'>...</script> which seems to give me

Did Auto-Bundling/Minification Get Tossed in Final Release of MVC 4?

拥有回忆 提交于 2019-12-23 12:14:14
问题 According to an article I read earlier by Scott Guthrie, and a video posted by Mads Kristensen, I should be able to auto-bundle/minify in ASP.net MVC 4 by replacing this: <link href="Styles/reset.css" rel="stylesheet" type="text/css" /> <link href="Styles/normalize.css" rel="stylesheet" type="text/css" /> <link href="Styles/styles.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.8.0.min.js" type="text/javascript"></script> <script src="Scripts/jquery-validation.min.js"

Empty Bundle using MS Bundling

孤街醉人 提交于 2019-12-21 05:17:20
问题 I am using asp.net mvc4 and the built in bundling and minification that is provided by MS using the System.Web.Optimization library (1.1.0) with a custom LessTransform using dotless. The site is hosted in IIS 7. My problem is that intermittently the bundle is empty on the website which causes the website to load all weird. http://site/Content/surveycss? What could cause this? UPDATE I read that if the less compiler encounters an error it could result in an empty bundle. I've tested the less