Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# MvcBuildViews忽略ascx和aspx,只编译cshtml_C#_Asp.net_Asp.net Mvc 4_Msbuild_Sitecore - Fatal编程技术网

C# MvcBuildViews忽略ascx和aspx,只编译cshtml

C# MvcBuildViews忽略ascx和aspx,只编译cshtml,c#,asp.net,asp.net-mvc-4,msbuild,sitecore,C#,Asp.net,Asp.net Mvc 4,Msbuild,Sitecore,在Siteocre项目中,我希望使用MvcBuildViews设置编译所有cshtml文件。不幸的是,这还编译任何ascx和aspx文件。我得到一个错误,比如: 32>/temp/Sitecore/admin/Wizard/InstallationLog.ascx1:错误 ASPPARSE:基类包含字段“logPanel”,但其类型为 System.Web.UI.HtmlControl.HtmlGenericControl与不兼容 控件System.Web.UI.HtmlControl.Html

在Siteocre项目中,我希望使用MvcBuildViews设置编译所有cshtml文件。不幸的是,这还编译任何ascx和aspx文件。我得到一个错误,比如:

32>/temp/Sitecore/admin/Wizard/InstallationLog.ascx1:错误 ASPPARSE:基类包含字段“logPanel”,但其类型为 System.Web.UI.HtmlControl.HtmlGenericControl与不兼容 控件System.Web.UI.HtmlControl.HtmlFrame的类型


有没有办法将视图编译限制为仅cshtml?

我将把我的注释转换为答案

将Sitecore放在Visual Studio文件夹中的方法不正确

您需要将IIS映射站点的Visual Studio和网站文件夹分开

下一个链接将很好地解释如何为Sitecore MVC创建Visual Studio项目


我将把我的评论转化为答案

将Sitecore放在Visual Studio文件夹中的方法不正确

您需要将IIS映射站点的Visual Studio和网站文件夹分开

下一个链接将很好地解释如何为Sitecore MVC创建Visual Studio项目


能否从项目Sitecore文件中排除?在项目中包含所有Sitecore文件是一种不好的做法。将您要覆盖的Sitecore文件放入您的项目中。它们不在我的csproj项目atm中。但它位于导致问题的同一文件夹中。aspnetcompiler似乎在一个文件夹中编译所有文件。您可以从项目Sitecore文件中排除吗?在项目中包含所有Sitecore文件是一种不好的做法。将您要覆盖的Sitecore文件放入您的项目中。它们不在我的csproj项目atm中。但它位于导致问题的同一文件夹中。aspnetcompiler似乎可以编译文件夹中的所有文件