installation problem

Sep 3, 2014 at 10:17 AM
I installed this toolkit by using NuGet Packages.Everthing is automation,but when I debugged my application.It shows

未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。

源错误:



行 15: public static void RegisterBundles(BundleCollection bundles)
行 16: {
行 17: bundles.Add(new ScriptBundle("~/bundles/basics").Include(
行 18: "~/Scripts/jquery-{version}.js")
行 19: .Include("~/Scripts/jquery.validate.min.js")


源文件: c:\Users\Administrator\Documents\Visual Studio 2012\Projects\CEMSWebSite\CEMSWebSite\App_Start\MVCCTBundleConfig.cs 行: 17

堆栈跟踪:



[NullReferenceException: 未将对象引用设置到对象的实例。]
System.Web.Optimization.BundleTable.<get_MapPathMethod>b__0(String virtualPath) +45
System.Web.Optimization.ItemRegistry.IncludeDirectory(String directoryVirtualPath, String searchPattern, PatternType patternType, Boolean searchSubdirectories) +189
System.Web.Optimization.ItemRegistry.Include(String[] virtualPaths) +581
System.Web.Optimization.Bundle.Include(String[] virtualPaths) +64
CEMSWebSite.App_Start.DMPBundleConfig.RegisterBundles(BundleCollection bundles) in c:\Users\Administrator\Documents\Visual Studio 2012\Projects\CEMSWebSite\CEMSWebSite\App_Start\MVCCTBundleConfig.cs:17
CEMSWebSite.App_Start.DMPBundleConfig.PreStart() in c:\Users\Administrator\Documents\Visual Studio 2012\Projects\CEMSWebSite\CEMSWebSite\App_Start\MVCCTBundleConfig.cs:10

[TargetInvocationException: 调用的目标发生了异常。]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
WebActivator.BaseActivationMethodAttribute.InvokeMethod() +236
WebActivator.ActivationManager.RunActivationMethods() +370
WebActivator.ActivationManager.RunPreStartMethods() +41
WebActivator.ActivationManager.Run() +64

[InvalidOperationException: 针对类型 WebActivator.ActivationManager 的应用程序预启动初始化方法 Run 引发了异常,显示下列错误消息: 调用的目标发生了异常。。]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection1 methods, Func1 setHostingEnvironmentCultures) +559
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516

[HttpException (0x80004005): 针对类型 WebActivator.ActivationManager 的应用程序预启动初始化方法 Run 引发了异常,显示下列错误消息: 调用的目标发生了异常。。]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9915300
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
Coordinator
Sep 4, 2014 at 6:31 PM
It appears that the javascript bundlig system be unable to load a javascript file causing a null reference error. Probably either ~/Scripts/jquery-{version}.js or ~/Scripts/jquery.validate.min.js. However, also possible ~/Scripts/jquery.validate.min.js if you are un debug node, since in this case the bundling system remove the .min and look for the uncompressed file. Maybe you deleted some uncompressed file thinking you don't need it...and this is the origin of the problem.
Consider also that this Nuget version doesnt support Mvc3 but only Mvc4 and Mvc5.

Let me know if my advices solved your problem.