Windows platform to deploy Asp.Net Core 3.1.0, will be released ASP.NET Core application to IIS, ASP.NET Core using IIS hosted on Windows

Part I: This tutorial shows you how to host ASP.NET Core applications on the IIS server.

  Official documents Address: https://docs.microsoft.com/zh-cn/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-3.1&tabs=visual-studio

 

This tutorial covers the following topics:

  • .NET Core Hosting Bundle is installed on Windows Server.
  • Creating IIS site in IIS Manager.
  • Deploy ASP.NET Core applications.

 I profile a bit, is to install two files:

       1, the installation . NET Core SDK  is mounted on a development computer (dotnet-sdk-3.1.100-win -x64.exe)

      Download: https://dotnet.microsoft.com/download . Select  Download .NET Core SDK  This version can be installed.

       2, the installation managed .NET Core bundle (dotnet-hosting-3.1.0.exe). Use the following link to download the installer:

                 Download: The current .NET Core hosting bundle installer (direct download)   https://www.microsoft.com/net/permalink/dotnetcore-current-windows-runtime-bundle-installer

        3, install the Web Platform Installer. (This step can be omitted, I see .net core 2.0 version was installed this, my windows10 installed, windows Server server is not installed).

                  Download: https://www.microsoft.com/web/downloads/platform.aspx

         4, restart the computer or execute the following command at the command line (I suggest the following command to restart the computer after it).

         Or restart the server performs net stop was / y, followed by the net start w3svc command line interface.

      

Part II: some configuration on publishing, deploying to iis of:

      1. With regard to visual studio 2019 released some configuration when .net core 3.0

      Release - Step 1: Select the Publish Destination: Select the folder, and then click Advanced: 

         

      Post - Step 2: Target frame: netcoreapp3.0, deployment mode: a frame-dependent, the target runtime: Portable selected. Then save.     

           

     Note: This description should focus on: the goal here runtime: win-x64, win-x86 is your first step when installing .net core running sdk version.

   When we first introduced, directly chose 64 in accordance with the package, so this article is to select all the screenshot is running 64-bit version.

     

 

     Release - Step 3: Click the Publish button to publish complete.

     

   2. deployed to iis.

          建议查看官方文档:将 ASP.NET Core 应用发布到 IIS ,https://docs.microsoft.com/zh-cn/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-3.1&tabs=visual-studio。

          这里截图列一下我的关键配置:

          1.应用程序池,选择无托管模式。我电脑是64位,选择“启用32位应用程序”为“false”。

            

            iis进程高级选项中,修改进程模块的“标识”为有固定权限的用户,也可按照官方文档操作,给有权限的iis应用程序账号。

            

 

 

 

      2.权限配置:

  

第三部分:使用 IIS 在 Windows 上托管 ASP.NET Core  问题太多:

  官方文档https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-3.1#iis-configuration 官方文档。

 

我部署过程中遇到的问题:如下

HTTP Error 500.0 - ANCM In-Process Handler Load Failure

Troubleshooting steps:

  • Check the system event log for error messages
  • Enable logging the application process' stdout messages
  • Attach a debugger to the application process and inspect

For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028526

下图: 

               

部署后出现的以上错误的原因可能有以下几点:

    1、没有安装第一部分中的前2个安装包,

    2、发布或者部署时运行时版本没有选择正确。现在一般都是64位。注意看商品的配置。  

    3、部署时i给的iis的权限不够。安装商品分配合适权限。

这样基本应该解决了90%的问题。

 

 其他参考:

       Windows平台部署Asp.Net Core应用(基于IIS和Windows服务两种模式) : https://blog.csdn.net/weixin_33757609/article/details/93693395 。

 

 

 

 

Guess you like

Origin www.cnblogs.com/davies/p/12038023.html