.net - AppHarbor 基于 ServiceStack.Razor 的网站预编译失败

标签 .net razor servicestack appharbor

我正在尝试部署目前非常简单的基于 ServiceStack.Razor 的 Web 应用程序到 AppHarbor,但在 ASP.NET 预编译步骤上失败:

Microsoft (R) ASP.NET Compilation Tool version 4.0.30319.17929
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.

d:\temp\ueggj0qu.hf5\temp\root\61980531\2c38de0c\App_Web_431dglyw.0.cs(15): error CS0146: Circular base class dependency involving 'RazorOutput.ViewPage' and 'RazorOutput.ViewPage'

[HttpCompileException]: d:\temp\ueggj0qu.hf5\temp\root\61980531\2c38de0c\App_Web_431dglyw.0.cs(15): error CS0146: Circular base class dependency involving 'RazorOutput.ViewPage' and 'RazorOutput.ViewPage'
   at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.WebDirectoryBatchCompiler.CompileAssemblyBuilder(AssemblyBuilder builder)
   at System.Web.Compilation.WebDirectoryBatchCompiler.<CompileNonDependentBuildProviders>b__0(AssemblyBuilder assemblyBuilder)
   at System.Web.Compilation.CompilationUtil.CompileParallel(ICollection assemblyBuilders, Action`1 action)
   at System.Web.Compilation.WebDirectoryBatchCompiler.CompileNonDependentBuildProviders(ICollection buildProviders)
   at System.Web.Compilation.WebDirectoryBatchCompiler.Process()
   at System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors)
   at System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileWebDirectoriesRecursive(VirtualDirectory vdir, Boolean topLevel)
   at System.Web.Compilation.BuildManager.PrecompileAppInternal(VirtualPath startingVirtualDir, IEnumerable`1 excludedVirtualPaths)
   at System.Web.Compilation.BuildManager.PrecompileApp(VirtualPath startingVirtualDir, IEnumerable`1 excludedVirtualPaths)
   at System.Web.Compilation.BuildManager.PrecompileApp(ClientBuildManagerCallback callback, IEnumerable`1 excludedVirtualPaths)
   at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths)
   at System.Web.Compilation.BuildManagerHost.PrecompileApp(ClientBuildManagerCallback callback, List`1 excludedVirtualPaths)
   at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback, Boolean forceCleanBuild)
   at System.Web.Compilation.ClientBuildManager.PrecompileApplication(ClientBuildManagerCallback callback)
   at System.Web.Compilation.Precompiler.Main(String[] args)

我确实知道我可以关闭预编译,但我宁愿现在就深入了解,然后再为项目添加更多复杂性。

该项目目前由非常基本的版本组成:

  • View /_Layout.cshtml
  • View /SomeServiceResponseView.cshtml
  • 内容/SomeStaticView.cshtml

静态 View 不是 100% 静态(它仍然是 Razor 生成的 View ),它只是不基于服务 DTO 模型。

_Layout 和 StaticView 均派生自 ViewPage(例如 @inherits ViewPage )。
ServiceResponseView 派生自 ViewPage 的通用模型版本(例如 @inherits ViewPage<SomeDtoResponse> )。

我已经在本地运行了 aspnet_compiler.exe 工具,但只能获得与上面相同的输出( AppHarbor FAQ 建议在本地运行它以帮助调试预编译问题,但我还没有找到任何方法给我更多信息...?)。

以前有人见过类似的错误消息吗?
任何对 Razor 幕后功能有更多了解的人都可以获得任何可能导致此问题的线索吗?
这是由于 ServiceStack.Razor 和普通 ASP.NET MVC Razor 之间的差异造成的问题吗?在这种情况下,关闭预编译是正确的解决方案吗?

最佳答案

我也必须在 AppHarbor 上禁用 View 预编译。

我相当确定它不可能启用,因为 ServiceStack Razor 页面有自己的构建过程,而且它们也不依赖于 System.Web.Mvc。

我认为 AppHarbor 进程需要 System.Web.Mvc Razor View 。

关于.net - AppHarbor 基于 ServiceStack.Razor 的网站预编译失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14171088/

相关文章:

.net - 忽略带有贪婪正则表达式的可选后缀

c# - 最小起订量和您传递的参数

javascript - 无法重载 Ajax.BeginForm 的提交方法

asynchronous - ServiceStack 和 OrmLite 中的异步支持

c# - 在 PHP 中是否有与 C# 的 Process.Start 等效的东西?

c# - 当某些JSON对象为字符串而某些为数组时,如何将JSON转换为列表字符串?

javascript - MVC Razor 表中的复选框检查选择为 false

asp.net-mvc-3 - Razor View 引擎,如何在 html 之间写入?

licensing - 如何停止 ServiceStack 3.9.71 NuGet 包安装 ServiceStack.Text 4.0.24?

c# - 在 Redis (ServiceStack RedisClient) 中使用事务自动增加 Id