【问题标题】:Cannot open any CSHTML file in a certain project [closed]无法在某个项目中打开任何 CSHTML 文件 [关闭]
【发布时间】:2014-07-24 12:15:53
【问题描述】:

当我在一个特定的 ASP.NET MVC 项目中打开一个 CSHTML 文件时,Visual Studio 2013 崩溃。

我可以在这个项目中打开其他文件,我可以在其他项目中打开CSHTML文件。

我和一位同事在其他计算机上顺利完成此项目。

我已经从我的计算机中删除了整个项目,并从我们的 Git 存储库中克隆了一个新副本,结果相同。

有什么线索吗?

编辑:

我查看了windows日志,发现如下错误:

应用程序:devenv.exe 框架版本:v4.0.30319 描述: 由于未处理的异常,进程被终止。异常信息: System.ArgumentException 堆栈:在 System.String.CompareTo(System.Object) 在 System.Web.Razor.Parser.RazorParser.ParseCore(System.Web.Razor.Text.ITextDocument) 在 System.Web.Razor.Parser.RazorParser.Parse(System.Web.Razor.Text.ITextDocument) 在 System.Web.Razor.RazorTemplateEngine.GenerateCodeCore(System.Web.Razor.Text.ITextDocument, 系统字符串,系统字符串,系统字符串, System.Nullable`1) 在 System.Web.Razor.Editor.BackgroundParser+BackgroundThread.ParseChange(System.Web.Razor.Text.ITextBuffer, System.Threading.CancellationToken) 在 System.Web.Razor.Editor.BackgroundParser+BackgroundThread.WorkerLoop() 在 System.Threading.ThreadHelper.ThreadStart_Context(System.Object) 在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object,布尔值)在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object,布尔值)在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object)在 System.Threading.ThreadHelper.ThreadStart()

【问题讨论】:

  • 可以将另一个 Visual Studio 实例附加到崩溃的实例(在它崩溃之前)并确定哪个 Razor 文件导致了问题。
  • 谢谢。我能够附加该过程,但它没有提供任何其他信息。我尝试在此项目中打开的任何 cshtml 文件都会出现错误。
  • 你尝试创建一个新的空白 cshtml 并打开它?调试起来绝对是一个棘手的问题
  • 我试图创建一个没有模型且没有指定布局的新视图。 VS 穿过脚手架,打开新视图,然后崩溃。

标签: asp.net asp.net-mvc visual-studio razor visual-studio-2013


【解决方案1】:

我终于通过改变解决了这个问题

<add key="webpages:Version" value="2.0.0.0" />

<add key="webpages:Version" value="3.0.0.0" />

在网络配置中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-16
    • 2016-06-12
    • 2013-03-08
    • 2016-03-13
    • 2015-08-19
    • 1970-01-01
    • 2021-10-30
    • 1970-01-01
    相关资源
    最近更新 更多