asp.net-optimization

How to resolve Antlr3 dependency hell

柔情痞子 提交于 2019-12-09 14:36:45
问题 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? 回答1:

mvc4 bundling strongly typed bundles

心已入冬 提交于 2019-12-09 13:01:47
问题 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

System.web.optimization AssetManager increases memory usage

 ̄綄美尐妖づ 提交于 2019-12-07 16:18:24
问题 I am doing so memory analysis for our project there is excessive usage of memory. This is what I got when I did a deep analysis. 回答1: I have recently found that minifing large minified files via ScriptBundle can cause excessive memory usage. In my case changing From: bundles.Add(new ScriptBundle("~/Bundles/Scripts/").Include(.... To: bundles.Add(new Bundle("~/Bundles/Scripts/").Include(.... Reduced my memory usage by around 300mb. Long term this obviously isn't a great solution, and you

“The located assembly's manifest definition does not match the assembly reference” on nuget package

烈酒焚心 提交于 2019-12-07 06:08:53
问题 So I was persistently getting this error on the System.Web.Optimization package Could not load file or assembly 'System.Web.Optimization' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 回答1: I finally found the solution after much trying. The key was in the Assembly load trace. LOG: Redirect found in application configuration file: 1.0.0.0 redirected to 1.1.0.0. Here are the steps I took to

ResolveBundleUrl not resolving all files?

梦想的初衷 提交于 2019-12-06 19:25:45
问题 I am new to MVC so thought I would start a new project and try out some of the new features in MVC4. I have two css files in my Content directory, normalise_mini and site.css . When I use the following code: <link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Content/css")" rel="stylesheet" type="text/css" /> It only takes my site.css file not my normalisation file. I have the following in my app start: protected void Application_Start() { // Remove all other view

ASP.NET MVC 4 app with bundling and minification, why is minification enabled in debug mode?

那年仲夏 提交于 2019-12-06 17:00:47
问题 I've just migrated an ASP.NET MVC 3 project to MVC 4 / .NET 4.0, and installed NuGet package Microsoft.AspNet.Web.Optimization in order to support bundling and minification of CSS and JavaScript. I've pretty much got bundling/minification working, the problem is it's always enabled. Even though the app is in debug mode, as configured in Web.config, all JavaScript includes are minified. As you can see from the below XML snippet, debug mode is enabled in Web.config: <system.web> <compilation

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

大城市里の小女人 提交于 2019-12-06 10:00:21
问题 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 bottom of the page before </body> . Since my project is a framework, the view doesn't know all of the bundles that the page will need. My project is making heavy use of editor templates, which may need to include some javascript, but can't render it in

What is the proper use of IItemTransform for correcting paths in CSS Bundling with ASP.NET Web Optimization and BundleTransformer?

安稳与你 提交于 2019-12-06 02:46:33
问题 I'm presently working on a project that uses the ASP.NET Web Optimization library (v 1.1.0-Beta1) in conjunction with the Bundle Transformer extension (v 1.7.3-Beta1 for core, 1.7.0-Beta1 for LESS) which is used to convert LESS into CSS. Based on web searches paths within CSS (and less) appear to be a common issue, in most cases it is recommended to manually modify the CSS and be done with it. However, due to differences between our development and production environment, and not owning the

NoTransform isn't working when trying to create new Bundle

二次信任 提交于 2019-12-06 01:02:36
问题 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

System.web.optimization AssetManager increases memory usage

一个人想着一个人 提交于 2019-12-05 20:10:07
I am doing so memory analysis for our project there is excessive usage of memory. This is what I got when I did a deep analysis. I have recently found that minifing large minified files via ScriptBundle can cause excessive memory usage. In my case changing From: bundles.Add(new ScriptBundle("~/Bundles/Scripts/").Include(.... To: bundles.Add(new Bundle("~/Bundles/Scripts/").Include(.... Reduced my memory usage by around 300mb. Long term this obviously isn't a great solution, and you should probably move to another solution ("Gulp" or "Bower"), but this may be enough to get through the next