【问题标题】:Pre-compile a MVC 5 app mixed with Webform预编译与 Webform 混合的 MVC 5 应用程序
【发布时间】:2014-06-23 02:37:20
【问题描述】:

我有一个混合了 Web 表单的 MVC 3 应用程序,其中包含许多“ascx”部分视图。该应用程序是预编译的,没有“可更新”内容。因此,Views 文件夹中的 cshtml 和 ascx 部分视图没有占位符标记。在我们最近将应用程序更新到 MVC 5 之前,一切都运行良好。更新后,除非您为每个用户控件创建一个虚拟占位符标记,否则该应用程序似乎不再找到“ascx”视图。否则会出现以下异常:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: The partial view '~/Views/Home/_PartialAscx.ascx' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/_PartialAscx.ascx

请注意,CSHTML 部分视图仍然可以正常工作。我唯一的问题是 ASCX 视图。

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

我们将不胜感激有关此问题的任何建议。

【问题讨论】:

    标签: asp.net asp.net-mvc


    【解决方案1】:

    结果证明这是 MVC 5.1 中的一个错误

    https://aspnetwebstack.codeplex.com/workitem/1709

    【讨论】:

      猜你喜欢
      • 2010-11-19
      • 1970-01-01
      • 1970-01-01
      • 2014-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-25
      • 2018-07-22
      相关资源
      最近更新 更多