突然之間(所以看起來)一個完美工作的MVC5與Bootstrap(LESS)解決方案拒絕運行。當我嘗試運行時,它只是給了我空白屏幕,並且網站永遠不會加載。如何從bootstrap grid.less和ClearScriptV8調試異常
當我在調試模式下運行,約90秒後,它崩潰與此異常:
Exception thrown: 'System.AccessViolationException' in ClearScriptV8-32.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
但是,如果我刪除/bootstrap/less/grid.less
解決方案將運行良好。
事情我已經試過
我試過換爲MSIE的V8發動機。這也暗示grid.less
是一個問題,特別是它指向這條線:.make-grid(sm);
我試圖關閉我的AV,因爲我看到建議的地方。它沒有任何區別。
我已經搜索了它,唯一明顯的相關信息是我發現這個鏈接。這表明關閉連接池,但我不知道如何做到這一點 - 或者,如果它甚至給我的解決方案相關的 - 因爲我沒有ReactConfig.cs
文件:
https://github.com/reactjs/React.NET/issues/102
我有點超出我的深度。任何人都可以幫助或建議我研究/調試此問題的方法嗎?
謝謝!
我發現了這個問題。引導LESS文件被包含兩次。下面回答。
堆棧跟蹤使用V8引擎
at Microsoft.ClearScript.V8.V8ContextProxyImpl.Execute(String gcDocumentName, String gcCode, Boolean evaluate, Boolean discard)
at Microsoft.ClearScript.V8.V8ScriptEngine.<>c__DisplayClass1b.<Execute>b__19()
at Microsoft.ClearScript.ScriptEngine.ScriptInvoke[T](Func`1 func)
at Microsoft.ClearScript.V8.V8ScriptEngine.BaseScriptInvoke[T](Func`1 func)
at Microsoft.ClearScript.V8.V8ScriptEngine.<>c__DisplayClass25`1.<ScriptInvoke>b__24()
at Microsoft.ClearScript.V8.?A0x792c8756.LockCallback(Void* pvArg)
at Microsoft.ClearScript.V8.V8ContextProxyImpl.InvokeWithLock(Action gcAction)
at Microsoft.ClearScript.V8.V8ScriptEngine.ScriptInvoke[T](Func`1 func)
at Microsoft.ClearScript.V8.V8ScriptEngine.Execute(String documentName, String code, Boolean evaluate, Boolean discard)
at JavaScriptEngineSwitcher.V8.V8JsEngine.InnerEvaluate(String expression)
at JavaScriptEngineSwitcher.V8.V8JsEngine.InnerEvaluate[T](String expression)
at JavaScriptEngineSwitcher.Core.JsEngineBase.Evaluate[T](String expression)
at BundleTransformer.Less.Internal.LessCompiler.Compile(String content, String path)
at BundleTransformer.Less.Translators.LessTranslator.InnerTranslate(IAsset asset, LessCompiler lessCompiler, Boolean enableNativeMinification)
at BundleTransformer.Less.Translators.LessTranslator.Translate(IList`1 assets)
at BundleTransformer.Core.Transformers.TransformerBase.Translate(IList`1 assets, Boolean isDebugMode)
at BundleTransformer.Core.Transformers.TransformerBase.Transform(IList`1 assets, BundleContext bundleContext, BundleResponse bundleResponse, VirtualPathProvider virtualPathProvider, Boolean isDebugMode)
at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse, Boolean isDebugMode)
at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse)
at System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable`1 bundleFiles)
at System.Web.Optimization.Bundle.GenerateBundleResponse(BundleContext context)
at System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context)
at System.Web.Optimization.BundleResolver.GetBundleContents(String virtualPath)
at System.Web.Optimization.AssetManager.DeterminePathsToRender(IEnumerable`1 assets)
at System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths)
at System.Web.Optimization.Styles.RenderFormat(String tagFormat, String[] paths)
at System.Web.Optimization.Styles.Render(String[] paths)
at ASP._Page_Views_Shared__Layout_cshtml.Execute() in C:\Users\MHL\OneDrive - FP\FpAccounting\FpAccounting\Views\Shared\_Layout.cshtml:line 7
堆棧跟蹤使用MSIE引擎
BundleTransformer.Core.Translators.AssetTranslationException was unhandled by user code
HResult=-2146233088
Message=During translation of LESS-code, readed from the file '/Content/Less/config.less', to CSS-code syntax error has occurred.
See more details:
Error type: Syntax
Message: Out of stack space
File: /ThirdPartyPlugins/bootstrap/less/grid.less
Line number: 66
Column number: 3
Source error:
Line 65: @media (min-width: @screen-sm-min) {
Line 66: .make-grid(sm);
-----------^
Line 67: }
Source=BundleTransformer.Less
StackTrace:
at BundleTransformer.Less.Translators.LessTranslator.InnerTranslate(IAsset asset, LessCompiler lessCompiler, Boolean enableNativeMinification)
at BundleTransformer.Less.Translators.LessTranslator.Translate(IList`1 assets)
at BundleTransformer.Core.Transformers.TransformerBase.Translate(IList`1 assets, Boolean isDebugMode)
at BundleTransformer.Core.Transformers.TransformerBase.Transform(IList`1 assets, BundleContext bundleContext, BundleResponse bundleResponse, VirtualPathProvider virtualPathProvider, Boolean isDebugMode)
at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse, Boolean isDebugMode)
at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse)
at System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable`1 bundleFiles)
at System.Web.Optimization.Bundle.GenerateBundleResponse(BundleContext context)
at System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context)
at System.Web.Optimization.BundleResolver.GetBundleContents(String virtualPath)
at System.Web.Optimization.AssetManager.DeterminePathsToRender(IEnumerable`1 assets)
at System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths)
at System.Web.Optimization.Styles.RenderFormat(String tagFormat, String[] paths)
at System.Web.Optimization.Styles.Render(String[] paths)
at ASP._Page_Views_Shared__Layout_cshtml.Execute() in C:\Users\MHL\OneDrive - FP\FpAccounting\FpAccounting\Views\Shared\_Layout.cshtml:line 7
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageBase.<>c__DisplayClass3.<RenderPageCore>b__2(TextWriter writer)
at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
at System.Web.WebPages.WebPageBase.Write(HelperResult result)
at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
at System.Web.WebPages.WebPageBase.PopContext()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
InnerException:
引導grid.less
個//
// Grid system
// --------------------------------------------------
// Container widths
//
// Set the container width, and override it for fixed navbars in media queries.
.container {
.container-fixed();
@media (min-width: @screen-sm-min) {
width: @container-sm;
}
@media (min-width: @screen-md-min) {
width: @container-md;
}
@media (min-width: @screen-lg-min) {
width: @container-lg;
}
}
// Fluid container
//
// Utilizes the mixin meant for fixed width containers, but without any defined
// width for fluid, full width layouts.
.container-fluid {
.container-fixed();
}
// Row
//
// Rows contain and clear the floats of your columns.
.row {
.make-row();
}
// Columns
//
// Common styles for small and large grid columns
.make-grid-columns();
// Extra small grid
//
// Columns, offsets, pushes, and pulls for extra small devices like
// smartphones.
.make-grid(xs);
// Small grid
//
// Columns, offsets, pushes, and pulls for the small device range, from phones
// to tablets.
@media (min-width: @screen-sm-min) {
.make-grid(sm);
}
// Medium grid
//
// Columns, offsets, pushes, and pulls for the desktop device range.
@media (min-width: @screen-md-min) {
.make-grid(md);
}
// Large grid
//
// Columns, offsets, pushes, and pulls for the large desktop device range.
@media (min-width: @screen-lg-min) {
.make-grid(lg);
}
JsEngineSwitcherConfig.cs
public class JsEngineSwitcherConfig
{
public static void Configure(JsEngineSwitcher engineSwitcher)
{
engineSwitcher.EngineFactories
.AddV8();
engineSwitcher.DefaultEngineName = V8JsEngine.EngineName;
}
}
......叫Global.asax中
JsEngineSwitcherConfig.Configure(JsEngineSwitcher.Instance);
而在Web.config中