Sto seguendo un esempio e non riesco a far funzionare il "NoTransform" quando si crea un pacchetto personalizzato per un progetto MVC. Ecco il mio codice che non verrà compilato a causa del "NoTransform" che genera un errore che dice "Errore 1 Impossibile trovare il tipo o il nome dello spazio dei nomi 'NoTransform' (manca una direttiva using o un riferimento assembly?)" . qualche idea?NoTransform non funziona quando si tenta di creare un nuovo pacchetto
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.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace CoyleAzure
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
// Added to Add DisplayModes
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Phone")
{
ContextCondition = (context => (
(context.GetOverriddenUserAgent() != null) &&
(
(context.GetOverriddenUserAgent().IndexOf("iPhone", StringComparison.OrdinalIgnoreCase) >= 0) ||
(context.GetOverriddenUserAgent().IndexOf("iPod", StringComparison.OrdinalIgnoreCase) >= 0) ||
(context.GetOverriddenUserAgent().IndexOf("Droid", StringComparison.OrdinalIgnoreCase) >= 0) ||
(context.GetOverriddenUserAgent().IndexOf("Blackberry", StringComparison.OrdinalIgnoreCase) >= 0) ||
(context.GetOverriddenUserAgent().StartsWith("Blackberry", StringComparison.OrdinalIgnoreCase))
)
))
});
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Tablet")
{
ContextCondition = (context => (
(context.GetOverriddenUserAgent() != null) &&
(
(context.GetOverriddenUserAgent().IndexOf("iPad", StringComparison.OrdinalIgnoreCase) >= 0) ||
(context.GetOverriddenUserAgent().IndexOf("Playbook", StringComparison.OrdinalIgnoreCase) >= 0) ||
(context.GetOverriddenUserAgent().IndexOf("Transformer", StringComparison.OrdinalIgnoreCase) >= 0) ||
(context.GetOverriddenUserAgent().IndexOf("Xoom", StringComparison.OrdinalIgnoreCase) >= 0)
)
))
});
IBundleTransform jsTransformer;
IBundleTransform cssTransformer;
#if DEBUG
jsTransformer = new NoTransform("text/javascript");
cssTransformer = new NoTransform("text/css");
#else
jsTransformer = new JsMinify();
cssTransformer = new CssMinify();
#endif
var
DesktopJSBundle = new Bundle("~/Scripts/DesktopJS", jsTransformer);
DesktopJSBundle.Include("~/Scripts/jquery-1.6.4. js");
DesktopJSBundle.Include("~/Scripts/jquery-ui-1.8.11. js");
DesktopJSBundle.Include("~/Scripts/jquery.unobtrusive-ajax.js");
DesktopJSBundle.Include("~/Scripts/jquery.validate.js");
DesktopJSBundle.Include("~/Scripts/jquery.validate.unobtrusive.js");
BundleTable.Bundles.Add(DesktopJSBundle);
var DesktopCSSBundle = new Bundle("~/Content/DesktopCSS", cssTransformer);
DesktopCSSBundle.Include("~/Content/Site.css");
BundleTable.Bundles.Add(DesktopCSSBundle);
var MobileJSBundle = new Bundle("~/Scripts/MobileJS", jsTransformer);
MobileJSBundle.Include("~/Scripts/jquery-1.6.4.js");
MobileJSBundle.Include("~/Scripts/jquery.mobile-1.1.0.js");
BundleTable.Bundles.Add(MobileJSBundle);
var MobileCSSBundle = new Bundle("~/Content/MobileCSS", cssTransformer);
MobileCSSBundle.Include("~/Content/jquery.mobile-1.1.0.css");
MobileCSSBundle.Include("~/Content/jquery.mobile.structure-1.1.0.css");
BundleTable.Bundles.Add(MobileCSSBundle);
//BundleTable.Bundles.RegisterTemplateBundles();
BundleTable.Bundles.EnableDefaultBundles();
}
//BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
quale versione di asp.net mvc ru usando? – VJAI