首页 文章

ASP .NET 5应用程序部署

提问于
浏览
2

我正在看ASP.NET 5的功能 . 我想知道AppDomain和AppPool如何适用于ASP.NET 5.在早期版本中,理想情况下,如果web.config或bin文件夹中有更改,AppDomain将重新启动 . 但是在.NET 5中,部署应用程序时不存在web.config和bin文件夹 . 此外,它可以在IIS之外托管(通过像k-web这样的命令) .

因此,如果我们在IIS或任何其他Web服务器中部署我们的.NET 5应用程序,它涉及的过程是什么 . 部署到IIS时如何重新启动AppDomain .

1 回答

  • 1

    如果您正在使用IIS(很可能)并且想要使用system.webServer部分配置IIS,则web.config文件仍然存在 . 如果您使用Azure并且希望在ASP.NET 5文档中看到here所示的完整错误详细信息,那么它也是必需的 .

    其次,您仍然可以通过选中属性窗口中的'生成输出构建'复选框,将项目构建到DLL中 . 这可以通过包含以下代码预编译您的视图(这仅适用于Beta 7):

    /// <summary>
    /// Enable pre-compilation of Razor views, so that errors in your .cshtml files are caught and displayed 
    /// in the Visual Studio errors window at compile time, rather than your sites users receiving a runtime 500 
    /// internal server error. Pre-compilation may reduce the time it takes to build and launch your project but will 
    /// cause the build time to increase. It will also stop edit and continue working for .cshtml files.
    /// </summary>
    public class RazorPreCompilation : RazorPreCompileModule
    {
        public RazorPreCompilation(IServiceProvider provider) : base(provider)
        {
            this.GenerateSymbols = true;
        }
    }
    

    我相信基于文件更改的应用程序域重新启动是IIS的一项功能,而不是应用程序本身的功能,我相信这将继续有效 . 如果您使用的是IIS之外的主机,那么您就是自己的主机 .

相关问题