“/”应用程序中的服务器错误。

对象类型无法转换为目标类型。

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

异常详细信息: System.ArgumentException: 对象类型无法转换为目标类型。

源错误:

只有在调试模式下进行编译时,生成此未经处理的异常的源代码才会显示出来。若要启用此功能,请执行以下步骤之一,然后请求 URL:

1. 在产生错误的文件的顶部添加一条“Debug=true”指令。例如:

  <%@ Page Language="C#" Debug="true" %>

或:

2. 将以下的节添加到应用程序的配置文件中:


   
       
   



请注意,第二个步骤将使给定应用程序中的所有文件在调试模式下进行编译;第一个步骤仅使该特定文件在调试模式下进行编译。

重要事项: 以调试模式运行应用程序一定会产生内存/性能系统开销。在部署到生产方案之前,应确保应用程序调试已禁用。

堆栈跟踪:


[ArgumentException: 对象类型无法转换为目标类型。]
   RazorEngine.Compilation.CleanupHelper.Init(AppDomain domain, IPrinter printer) +0
   RazorEngine.Compilation.InitHelper.CreateHelper() +212
   RazorEngine.Compilation.FuncConv`1.Call(Boolean data) +10
   RazorEngine.Compilation.CallHelperSafeHelper`2.AsAction() +17
   RazorEngine.Compilation.CallHelperSafeHelper`2.AsContextCallback(Object state) +4
   System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) +166
   System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) +21
   System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) +64
   RazorEngine.Compilation.ExecutionContextLessThread.DefaultCallFunc(Func`1 f) +223
   RazorEngine.Compilation.CrossAppDomainCleanUp..ctor(AppDomain toWatch, IPrinter printer) +341
   RazorEngine.Compilation.CrossAppDomainCleanUp.CreateInitial() +36
   System.Lazy`1.CreateValue() +180
   System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +22
   System.Lazy`1.get_Value() +10892105
   RazorEngine.Compilation.CrossAppDomainCleanUp.get_CurrentCleanup() +27
   RazorEngine.Compilation.CrossAppDomainCleanUp.RegisterCleanup(String item, Boolean throwOnDefault) +259
   RazorEngine.Templating.<>c.<.ctor>b__5_0(String item) +9
   RazorEngine.Templating.InvalidatingCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey) +52
   RazorEngine.Templating.DefaultCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey) +14
   RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType) +47
   RazorEngine.Templating.RazorEngineService.Compile(ITemplateKey key, Type modelType) +8
   RazorEngine.Templating.DynamicWrapperService.Compile(ITemplateKey key, Type modelType) +31
   Lerwin.Web.UI.Utility.DefaultRazorHelper.Compile(String dirName) in D:\vss\已完成\澳门新葡游戏中心app下载\Lerwin.Web.UI\Utility\DefaultRazorHelper.cs:120
   Lerwin.Web.UI.Utility.DefaultRazorHelper.PageOutput(HttpContext context) in D:\vss\已完成\澳门新葡游戏中心app下载\Lerwin.Web.UI\Utility\DefaultRazorHelper.cs:61
   Lerwin.Web.UI.Page.InnerPage.ResponseWrite() in D:\vss\已完成\澳门新葡游戏中心app下载\Lerwin.Web.UI\Page\InnerPage.cs:116
   Lerwin.Web.UI.Page.InnerPage.ShowPage() in D:\vss\已完成\澳门新葡游戏中心app下载\Lerwin.Web.UI\Page\InnerPage.cs:88
   Lerwin.Web.UI.BasePage..ctor() in D:\vss\已完成\澳门新葡游戏中心app下载\Lerwin.Web.UI\BasePage.cs:38
   Lerwin.Web.UI.Page.InnerPage..ctor() in D:\vss\已完成\澳门新葡游戏中心app下载\Lerwin.Web.UI\Page\InnerPage.cs:38
   ASP.aspx_main_index_aspx..ctor() +13
   __ASP.FastObjectFactory_app_web_uxgk55v4.Create_ASP_aspx_main_index_aspx() +20
   System.Web.Compilation.BuildResultCompiledType.CreateInstance() +30
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +100
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
   System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path) +37
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +346
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155


版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.36480
Baidu
sogou