My MVC website has Runtime Error, starting with a class BundleConfigwith the following heading:
An exception of type 'System.NullReferenceException' occurred in mscorlib.dll but was not processed in user code

Usings:
using System.Web.Optimization;
using BundleTransformer.Core.Bundles;
using BundleTransformer.Core.Orderers;
using BundleTransformer.Core.Transformers;
Stack trace:
[NullReferenceException: Object reference not set to an instance of an object.]
BundleTransformer.Core.BundleTransformerContext..ctor() +162
BundleTransformer.Core.BundleTransformerContext.<.cctor>b__0() +44
System.Lazy`1.CreateValue() +416
System.Lazy`1.LazyInitValue() +152
System.Lazy`1.get_Value() +75
BundleTransformer.Core.BundleTransformerContext.get_Current() +60
BundleTransformer.Core.Transformers.CssTransformer..ctor(IMinifier minifier, IList`1 translators, IList`1 postProcessors, String[] ignorePatterns) +79
BundleTransformer.Core.Transformers.CssTransformer..ctor() +97
NWebsite.BundleConfig.RegisterBundles(BundleCollection bundles) in d:\Documents\Visual Studio 2013\Projects\N\Web\N.Website\App_Start\BundleConfig.cs:18
NWebsite.MvcApplication.Application_Start() in d:\Documents\Visual Studio 2013\Projects\N\Web\N.Website\Global.asax.cs:20
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9916613
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930508
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
And the MvcApplication class in the Global.asax file:
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
What is the reason and how can I solve it?
source
share