我正在选择一个旧的 ASP.NET WebForms 项目,我在启动时得到了这个:
长度不能小于 0 或超过输入长度。参数名称:长度
令人费解的是,我的应用程序代码不在堆栈跟踪中。这是显示的内容:
[ArgumentOutOfRangeException: Length cannot be less than 0 or exceed input length.
Parameter name: length]
System.Text.RegularExpressions.Regex.Run(Boolean quick, Int32 prevlen, String input, Int32 beginning, Int32 length, Int32 startat) +6697802
System.Text.RegularExpressions.Regex.Match(String input, Int32 beginning, Int32 length) +48
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.LiteralWithCommentsHelper.FindComments(String source, Int32 sourceStart, Int32 sourceEnd) +89
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.LiteralWithCommentsHelper..ctor(String source, Int32 sourceStart, Int32 sourceEnd) +27
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingParseRecorder.PostProcessBlockList() +311
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingParseRecorder.BuildBlockList(ControlBuilder root) +100
Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.SelectionMappingParseRecorder.ParseComplete(ControlBuilder root) +101
System.Web.UI.ParseRecorderList.ParseComplete(ControlBuilder root) +71
System.Web.UI.TemplateParser.HandlePostParse() +184
System.Web.UI.TemplateControlParser.HandlePostParse() +13
System.Web.UI.PageParser.HandlePostParse() +12
System.Web.UI.TemplateParser.Parse() +154
System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() +110
System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +59
System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +209
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +15
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +9929933
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +299
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +165
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +43
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +64
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +191
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +145
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
我刚刚接手这个项目,所以我不确定发生了什么变化,但我知道它在过去的某个时候有效。:) 最近,我将项目文件从 VS 2010 升级到 VS 2012,但是没有引发任何警告,因此出现这种情况似乎很奇怪。这是一个用 VB.NET 编写的 .NET 4.0 项目。
关于在哪里寻找或如何进一步诊断的任何想法?