麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁(yè) > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

OWIN 中 K Commands 與 OwinHost.exe 相等嗎?

2019-11-17 01:58:38
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

OWIN 中 K Commands 與 OwinHost.exe 相等嗎?

  • OwinHost.exe: While some will want to write a custom PRocess to run Katana Web applications, many would prefer to simply launch a pre-built executable that can start a server and run their application. For this scenario, the Katana component suite includes OwinHost.exe. When run from within a project’s root directory, this executable will start a server (it uses the HttpListener server by default) and use conventions to find and run the user’s startup class. For more granular control, the executable provides a number of additional command line parameters.
  • K Commands: Whenever you want to run your app in command line using K* commands, you will use k run. The K command is your entry point to the runtime. To run an application you can use K run to build you can use K build, and all other commands that are about taking your application and running it.

K Commands 是 APS.NET 5 引出的,根據(jù)說(shuō)明知道它是加載與啟動(dòng) OWIN 組件的一個(gè)命令,那 OwinHost.exe 是什么?它其實(shí)是之前 OWIN 的實(shí)現(xiàn) Katana 項(xiàng)目中的一個(gè)東西,這個(gè)東西是什么?看一下源碼結(jié)構(gòu):

摘自 Program.cs 中的一段源代碼:

using System;using System.Collections.Generic;using System.Diagnostics.CodeAnalysis;using System.Globalization;using System.IO;using System.Linq;using System.Reflection;using Microsoft.Owin.Hosting;using Microsoft.Owin.Hosting.Services;using Microsoft.Owin.Hosting.Starter;using Microsoft.Owin.Hosting.Utilities;using OwinHost.Options;namespace OwinHost{    public static class Program    {        public static void RunServer(StartOptions options)        {            if (options == null)            {                return;            }            string boot;            if (!options.Settings.TryGetValue("boot", out boot)                || string.IsNullOrWhiteSpace(boot))            {                options.Settings["boot"] = "Domain";            }            ResolveAssembliesFromDirectory(                Path.Combine(Directory.GetCurrentDirectory(), "bin"));            WriteLine("Starting with " + GetDisplayUrl(options));            IServiceProvider services = ServicesFactory.Create();            var starter = services.GetService<IHostingStarter>();            IDisposable server = starter.Start(options);            WriteLine("Started successfully");            WriteLine("Press Enter to exit");            Console.ReadLine();            WriteLine("Terminating.");            server.Dispose();        }    }}

可以看到,它其實(shí)和 Microsoft.aspNet.Hosting/Program.cs 中的配置代碼很相似,但不相同,Microsoft.AspNet.Hosting 是 OWIN Host 的所有概念實(shí)現(xiàn),而 OwinHost 只是一個(gè)控制臺(tái)啟動(dòng)程序,用來(lái)加載所有的 OWIN 組件,但它不包含任何的實(shí)現(xiàn),比如 Host 中的 Builder、Server、Startup 等一些操作,再看下面一張圖就明白了:

對(duì),沒錯(cuò),OwinHost 依賴于 Microsoft.Owin.Hosting,OwinHost 中所有的 Host 操作都在 Microsoft.Owin.Hosting 中進(jìn)行完成了,說(shuō)白了,OwinHost 沒多少東西,就是一個(gè)開啟命令,和 Microsoft.AspNet.Hosting 完全不是一個(gè)概念問(wèn)題,那 OwinHost 和 K Commands 相等嗎?其實(shí)也不相等,只是很類似,但這個(gè)類似點(diǎn)只是體現(xiàn)在加載 OWIN 組件的時(shí)候,OwinHost 的工作就是干這個(gè)的,并且只能干這個(gè),而 K Commands 卻不僅僅如此,它還包含了其他的一些命令管理,比如“gen”、“ef”等。

其他相關(guān)資料:

  • What is the difference between using Owinhost.exe to run an OWIN web service or a Console App
  • Visual Studio 2013 Custom Web Servers and OwinHost.exe

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 日韩一级片黄色 | 欧日韩在线视频 | 国产自91精品一区二区 | xvideos korean| 国产成人自拍视频在线 | 龙的两根好大拔不出去h | 国产又白又嫩又紧又爽18p | 在线观看免费污视频 | 老女人碰碰在线碰碰视频 | 欧洲精品色 | 龙床上的呻吟高h | 韩国草草影院 | 久夜tv| 羞羞答答影院 | bt 自拍 另类 综合 欧美 | 成人午夜天堂 | 天天躁狠狠躁夜躁2020挡不住 | 国产88久久久国产精品免费二区 | 成人在线观看地址 | 夜添久久精品亚洲国产精品 | 欧美激情视频一区二区免费 | 国产a级久久 | 久久精品视频一区 | 国产毛片在线 | 国产激情网 | 国产精品夜色视频一级区 | 午夜国产在线 | 在线中文字幕网站 | 国产精选电影免费在线观看网站 | 成人免费一区二区 | 成人在线视频免费 | 久久最新网址 | 精品亚洲成a人在线观看 | 国内精品视频饥渴少妇在线播放 | 亚洲免费永久 | 国产日韩三区 | 黄色网址在线播放 | 毛片在线视频免费观看 | 亚洲综合一区在线观看 | 精品麻豆cm视频在线看 | 亚洲午夜久久久精品一区二区三区 |