dotnet core hosting

1. Managed form

  In hosted form dotnet core into a managed process (InProcess), hosted out of process (OutOfProcess)

  The new Web program with csproj

    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>

  That is, within the hosting, delete this line host not default

2. hosted within

  

  First add this string of code to Configure, to show the process name

        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.Run(async (context) =>
            {
                var proessName = Process.GetCurrentProcess().ProcessName;
                await context.Response.WriteAsync(proessName);
            });
        }

  Then run the process, a process called

      

3. hosted outside

  

 

  Named according to 1, hosting changed outside, start the process, the process

     

  It is also possible to run cmd in the following directory directly by dotnet run to start the project dotnet run start

      

 4. Summary

  

  Due to the use of a reverse proxy server, hosting outdoor use process better.

 

Guess you like

Origin www.cnblogs.com/wskxy/p/11404178.html