asp.net-optimization

NoTransform isn't working when trying to create new Bundle

本小妞迷上赌 提交于 2019-12-04 06:27:16
I am following an example and cannot get the "NoTransform" to work when creating a custom bundle for an MVC project. Here is my code that won't compile because of the "NoTransform" yielding an error that says, "Error 1 The type or namespace name 'NoTransform' could not be found (are you missing a using directive or an assembly reference?)". Any thoughts? using System; using System.Collections.Generic; using System.Configuration; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Linq; using System.Web; using System.Web.Http; using System.Web.WebPages; using System

How to resolve Antlr3 dependency hell

橙三吉。 提交于 2019-12-04 00:33:51
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 comes with its own Antlr3 dll, signed by Microsoft - PublicKeyToken 31bf3856ad364e35 Antlr3 default PublicKeyToken is eb42632606e9261f. RavenDB and WebGrease use the same version of Antlr3 3.3.1.7705 How can I resolve this problem? Unfortunately I did not found a solution to conflicting dependencies of same version with different signatures. But the

Absolute URL in ASP bundle

本小妞迷上赌 提交于 2019-12-03 23:27:09
问题 I use a jQuery library for Google Maps, and it depends on the Google scripts to be loaded first. I'd like to be able to include both in the bundle as such: bundles.Add(new ScriptBundle("myfoobundle").Include( "http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places", "~/scripts/jquery.fooplugin-{version}.js" )); This doesn't seem to work (throws an exception complaining about the first string). And one may say that this shouldn't work because that absolute URL is not meant to be

Empty Bundle using MS Bundling

时间秒杀一切 提交于 2019-12-03 16:38:16
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 for errors and there are none. I discovered that there maybe an issue with the way that the bundle was

mvc4 bundling strongly typed bundles

℡╲_俬逩灬. 提交于 2019-12-03 15:12:00
So MVC 4 introduces script and style bundling. Which allows for this: public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/mobile").Include( "~/Scripts/jquery.mobile-*")); then used in a razor view like this: @Scripts.Render("~/bundles/mobile") My question is why do I have to type "~/bundles/mobile" ? Is there a way get intellisence to have a strongly typed object to pick up on? Otherwise I have to go look it up to make sure I call it the same thing. I would like to do something like this: (I know this won't compile this way, it's just an

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

若如初见. 提交于 2019-12-03 11:33:44
问题 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 StyleBundle("~/stylesheet") .Include("~/css/main.css") .Include("~/css/mvc.css") .Include("~/js/jquery.thickbox.css") .Include("~/js/jquery.rating.css") .Include("~/css/ProductListing.css") .Include("~/css/dropdown/dropdown.css") .Include("~/css/dropdown

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

折月煮酒 提交于 2019-12-03 10:33:49
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 searches for CSS and JS files on the drive and ignores the bundling system, but I can't find anyone else who is trying to include file extensions in bundle names. Is this possible to do without something like a URL rewrite? Darin Dimitrov You could add the following to your <system.webServer> section in web.config: <modules runAllManagedModulesForAllRequests="true

Can you pre-cache ASP.NET Bundles?

可紊 提交于 2019-12-03 03:01:06
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 static at compile time. Solution To fix we replaced the default memory cache with caching that persisted beyond the App Pool life. To do this we inherited from ScriptBundle and overrode CacheLookup() and UpdateCache() . /// <summary> /// override cache functionality in ScriptBundle to use /// persistent cache instead of HttpContext.Current.Cache /// <

Runtime dynamic bundling and minifying in MVC 4

。_饼干妹妹 提交于 2019-12-02 22:35:09
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 approach would be to create all bundles upfront and change the virtual path of resolvebundleurl based on the setting of the user, but that feels not really the right way. Also I have dynamic css in a cshtml view based on user-settings, which I would like to have minified in runtime. Any suggestions? I also see a lot of reactions in other questions to

Cassette bundles vs MVC4 bundles

六月ゝ 毕业季﹏ 提交于 2019-12-02 20:02:03
I am currently working on a prototype ASP.NET MVC 3 solution that will be used as a base for several project rewrites (from web forms). One of the goals that I have is to implement some script management across application as opposed to none that we currently have. MVC 3 has a flaw IMHO: if you need specific script specified on a partial view or template view - you might end up either losing control over where script block is located in rendered HTML or having to specify every single dependent javascript file on the parent View. I have been seriously considering using http://getcassette.net/