Open sirajmansour-infotrack opened 7 years ago
Are you sure you're using your pre-compiled views? You shouldn't get that at runtime unless you're trying to emit a PDB stream, which would be if you're hitting the RoslynRazorViewEngine instead of the PrecompiledViewEngine?
A complete stack trace of the exception would also be very helpful.
Thanks for the insight, i'll look more into it. It is very random the way it happens and no consistency in the way the issue appears.
In our global.asax.cs we definitely have
ViewEngines.Engines.Clear();
#if !DEBUG
// use precompiled engine first (supports some C# 6),
ViewEngines.Engines.Add(new PrecompiledViewEngine(typeof(Controllers.HomeController).Assembly));
#endif
ViewEngines.Engines.Add(new RoslynRazorViewEngine());
We use TC as our build server, release mode is chosen in all our release configs.
Could it be that for some reason the PrecompiledViewEngine fails to find the view, so it falls back to the RoslynRazorViewEngine one ?.
I suspected the Virtual application path could be behind the problem when trying to locate views, but i believe it is not possible since that issue would always show up then, but instead it doesn't.
Get same problem on production after 7 days of work
System.Web.HttpParseException (0x80004005): error CS0041: Unexpected error writing debug information -- 'The version of Windows PDB writer is older than required: 'diasymreader.dll''
at StackExchange.Precompilation.RoslynRazorViewEngine.CompileToAssembly(WebPageRazorHost host, SyntaxTree syntaxTree)
at StackExchange.Precompilation.RoslynRazorViewEngine.GetTypeFromVirtualPathNoCache(String virtualPath)
at StackExchange.Precompilation.RoslynRazorViewEngine.GetTypeFromVirtualPath(String virtualPath)
at StackExchange.Precompilation.RoslynRazorViewEngine.CreateView(ControllerContext controllerContext, String viewPath, String masterPath)
at System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache)
at StackExchange.Profiling.Mvc.ProfilingViewEngine.<>cDisplayClass4.1 finder, Boolean isPartial) at System.Web.Mvc.ViewEngineCollection.<>c__DisplayClass6.<FindView>b__5(IViewEngine e) at System.Web.Mvc.ViewEngineCollection.Find(Func
2 lookup, Boolean trackSearchedPaths)
at System.Web.Mvc.ViewEngineCollection.Find(Func2 cacheLocator, Func
2 locator)
at System.Web.Mvc.ViewResult.FindView(ControllerContext context)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 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)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 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)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 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)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag)
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
Full Trace:
RaiseOnError at offset 126 in file:line:column
After changing our build process to use the StackExchange precompiler, everything builds successfully and our build time has drastically improved thanks to this great compiler.
However we're seeing this runtime error on some of our environments as soon as we started using the stackexchange precompiler. Oddly enough, on the same environments we deploy the same application twice but with different configs, one works fine and the other is just broken because of this this runtime error :
Windows PDB writer is not available -- could not find Microsoft.DiaSymReader.Native.x86.dll
.We generate and keep PDB files for our test and staging environments.
One theory is that one of the applications is deployed in IIS as a Website, and the other as a Web Application, but both exactly under the same privileges, Application Pool, settings, etc... But we couldn't prove this exactly either.
We're not very sure the cause behind this, in some cases re-installing visual c++ 2015 redistributable on the server fixed the issue, but in other cases it didn't.
Any help on this would be appreciated.