我正在尝试将当前基于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)
我确实知道我可以关闭预编译,但我宁愿现在深入了解这一点,然后再为项目增加更多复杂性。
该项目目前包含以下非常基本的版本:
- 视图/_Layout.cshtml
- 视图/SomeServiceResponseView.cshtml
- 内容/SomeStaticView.cshtml
静态视图不是 100% 静态的(它仍然是 Razor 生成的视图),它只是不基于服务 DTO 模型。
_Layout 和 StaticView 都派生自 ViewPage(例如@inherits ViewPage
)。
ServiceResponseView 派生自 ViewPage 的通用模型版本(例如@inherits ViewPage<SomeDtoResponse>
)。
我已经在本地运行了 aspnet_compiler.exe 工具,但只能获得与上面相同的输出(AppHarbor FAQ建议在本地运行它以帮助调试预编译问题,但我还没有找到任何方法让它给我任何更多信息...?)。
有没有人见过类似的错误信息?
任何对 Razor 在幕后所做的事情有更多了解的人都知道可能导致这种情况的任何线索?
这是由于 ServiceStack.Razor 和普通 ASP.NET MVC Razor 之间的差异而导致的问题,在这种情况下关闭预编译是正确的解决方案?