{"id":272801,"date":"2016-01-25T10:57:03","date_gmt":"2016-01-25T07:57:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=272801"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=272801","title":{"rendered":"\u0413\u043e\u0442\u043e\u0432\u0438\u043c ASP.NET Core: \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e OWIN \u0438 Katana"},"content":{"rendered":"<br \/>\n<blockquote><p><i>\u041c\u044b \u0440\u0430\u0434\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 ASP.NET Core (\u0440\u0430\u043d\u0435\u0435 ASP.NET 5). \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0412\u044f\u0447\u0435\u0441\u043b\u0430\u0432 \u0411\u043e\u0431\u0438\u043a \u2014 .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Radario, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0441\u0432\u043e\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u043e\u043c \u043f\u0440\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 OWIN, Katana \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u0412\u0441\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0446\u0438\u043a\u043b\u0430 \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0442\u0443\u0442 <a href=\"https:\/\/habrahabr.ru\/search\/?q=%5B%23aspnetcolumn%5D&amp;target_type=posts\">#aspnetcolumn<\/a> \u2014 \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440 \u042e\u043d\u0435\u0432<\/i><\/p><\/blockquote>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438<\/h3>\n<p>  \u0412 \u0434\u0430\u043b\u0435\u043a\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f ASP.NET MVC \u0432\u0435\u0440\u0441\u0438\u0438 CTP, \u043d\u0438\u043a\u0442\u043e \u0438 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f, \u043e \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043e\u0441\u0442\u0438, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0444\u0440\u0435\u0439\u0432\u043e\u0440\u043a\u0435, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 IIS, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0432\u044d\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u041e\u0421.  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" width=\"650\"  src=\"https:\/\/habrastorage.org\/files\/ffa\/815\/656\/ffa815656ced4d5c8a3933015758f802.png\"\/><\/div>\n<p>\u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c, \u0431\u043e\u0433\u0430\u0442\u0441\u0442\u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 ASP.NET MVC \u0440\u043e\u0441\u043b\u043e, \u0440\u043e\u0441\u043b\u0430 \u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <em>System.Web<\/em>, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0444\u0440\u0435\u0439\u043c\u0444\u043e\u0440\u043a \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u0432\u043e\u0440\u043a \u0441\u0442\u0430\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043f\u043e\u0447\u0442\u0438 \u043f\u0440\u0438\u0431\u0438\u0442\u044b\u043c \u0433\u0432\u043e\u0437\u0434\u044f\u043c\u0438 \u043a IIS.<\/p>\n<p>  \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0431\u044b\u043b ASP.NET Web API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0438\u043c\u0435\u043b \u043f\u0440\u044f\u043c\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u0439\u043b\u044c IIS, \u0438 \u043c\u043e\u0433 \u0445\u043e\u0441\u0442\u0438\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0435\u0437 IIS(self-hosting). \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043a \u0440\u0435\u0431\u044f\u0442\u0430\u043c \u0438\u0437 Microsoft \u043f\u0440\u0438\u0448\u043b\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u0435\u043d \u0438\u043d\u0441\u0442\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u044d\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 .Net \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 IIS, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u044d\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0442\u044c \u0433\u0438\u0431\u043a\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0412 \u0438\u0442\u043e\u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f OWIN \u0438 \u043f\u0440\u043e\u0435\u043a\u0442 Katana.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 OWIN<\/h3>\n<p>  <strong>Katana<\/strong> \u2014 \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u044d\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 hosting abstraction. Hosting abstraction \u2014 \u044d\u0442\u043e OWIN. \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 OWIN \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>application delegate<\/strong> \u0438\u043b\u0438 <strong>AppFunc<\/strong>.<\/p>\n<pre><code class=\"cs\">using AppFunc = Func&lt;IDictionary&lt;string, object&gt;, Task&gt;; <\/code><\/pre>\n<p>  \u041a\u0430\u0436\u0434\u043e\u0435 OWIN \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c <strong>Startup<\/strong> \u043a\u043b\u0430\u0441\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043e \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441 Startup \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c Configuration, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 IAppBuilder<\/p>\n<pre><code class=\"cs\">public class Startup {   public void Configuration(IAppBuilder app) {     app.Use(...);     app.Use(...);   } } <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u043a\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <em>app.Use(..)<\/em> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0433\u0438\u0431\u043a\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432(pipeline).<\/p>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u2014 \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c:<\/p>\n<pre><code class=\"cs\">[assembly: OwinStartup(typeof(App.TestApp))] <\/code><\/pre>\n<p>  \u0412 ASP.NET Core \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 OWIN \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Katana, \u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u043c\u0438. \u0422\u0430\u043a <em>IAppBuilder<\/em>\u0431\u044b\u043b \u0437\u0430\u043c\u0435\u043d\u0435\u043d \u043d\u0430 <em>IApplicationBuilder<\/em>, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 Katana \u0432\u0430\u043c \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0440\u0443\u0434\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 OWIN \u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0432\u043e \u0432\u0441\u0435\u043c \u043c\u0438\u0440\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 hello world \u043c\u043e\u0434\u0443\u043b\u044c. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u043e\u0439 ASP.NET Core \u043f\u0440\u043e\u0435\u043a\u0442. \u0412\u0430\u0448 Startup \u043a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public class Startup     {         public void ConfigureServices(IServiceCollection services)         {         }         public void Configure(IApplicationBuilder app)         {             \/\/ Add the platform handler to the request pipeline.             app.UseIISPlatformHandler();             app.Run(async (context) =&gt;             {                 await context.Response.WriteAsync(&quot;Hello World!&quot;);             });         }     }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0430\u0447\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e ASP.NET 5 beta-8 (<i>\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u0412\u042e<\/i>), \u0432 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Startup \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443. \u0422\u0430\u043a \u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c nuget \u043f\u0430\u043a\u0435\u0442 Microsoft.AspNet.Owin. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0439\u0434\u0435\u043c \u0432 project.json \u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 dependencies \u0432\u0441\u0442\u0430\u0432\u0438\u043c.<\/p>\n<pre><code class=\"cs\">Microsoft.AspNet.Owin&quot; : &quot;1.0.0-beta8&quot; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"cs\">public Task OwinHello(IDictionary&lt;string, object&gt; enviroment)         {             var responseText = &quot;Hello via Owin&quot;;             var responseBytes = Encoding.UTF8.GetBytes(responseText);             var responseStream = (Stream)enviroment[&quot;owin.ResponseBody&quot;];             var responseHeaders = (IDictionary&lt;string, string[]&gt;)enviroment[&quot;owin.ResponseHeaders&quot;];             responseHeaders[&quot;Content-Length&quot;] = new string[] { responseBytes.Length.ToString(CultureInfo.InvariantCulture) };             responseHeaders[&quot;Content-Type&quot;] = new string[] { &quot;text\/plain&quot; };             return responseStream.WriteAsync(responseBytes, 0, responseBytes.Length);         } <\/code><\/pre>\n<p>  \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u044b\u0437\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 OwinHello \u0432 \u043c\u0435\u0442\u043e\u0434 Configure.<\/p>\n<pre><code class=\"cs\">app.UseOwin(pipeline =&gt; pipeline(next =&gt; OwinHello)); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 Startup \u043a\u043b\u0430\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">public class Startup     {         public void ConfigureServices(IServiceCollection services)         {         }         public void Configure(IApplicationBuilder app)         {             \/\/ Add the platform handler to the request pipeline.             app.UseIISPlatformHandler();             app.UseOwin(pipeline =&gt; pipeline(next =&gt; OwinHello));              app.Run(async (context) =&gt;             {                 await context.Response.WriteAsync(&quot;Hello World&quot;);             });         }         public Task OwinHello(IDictionary&lt;string, object&gt; enviroment)         {             var responseText = &quot;Hello Owin&quot;;             var responseBytes = Encoding.UTF8.GetBytes(responseText);             var responseStream = (Stream)enviroment[&quot;owin.ResponseBody&quot;];             var responseHeaders = (IDictionary&lt;string, string[]&gt;)enviroment[&quot;owin.ResponseHeaders&quot;];             responseHeaders[&quot;Content-Length&quot;] = new string[] { responseBytes.Length.ToString(CultureInfo.InvariantCulture) };             responseHeaders[&quot;Content-Type&quot;] = new string[] { &quot;text\/plain&quot; };             return responseStream.WriteAsync(responseBytes, 0, responseBytes.Length);         }     } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 &quot;Hello Owin&quot;. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441: &quot;\u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u044b\u0432\u0435\u043b\u0430\u0441\u044c \u0440\u0430\u0437\u0430 Hellow Owin \u0431\u0435\u0437 Hello World?&quot;. \u0412\u0441\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/github.com\/owin\/owin\/blob\/master\/spec\/owin-1.1.0.md#35-response-body\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0445\u0435\u0434\u0435\u0440\u043e\u0432, \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0434\u0430, \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0442.\u0434., \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430(response body stream).<\/p>\n<p>  \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044f \u043a\u043b\u044e\u0447\u0438 <code>owin.ResponseBody<\/code> \u0438 <code>owin.ResponseHeaders<\/code>. \u0412\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u044e\u0447\u0435\u0439 \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/owin\/owin\/blob\/master\/spec\/owin-1.1.0.md#32-environment\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/a>. \u0421 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430, \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f owin, <code>Run<\/code> \u0438 <code>Use<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0434\u0435\u043b\u0430\u044e\u0442 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435. \u042d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0430\u043a.<\/p>\n<p>  <code>Run<\/code> \u2014 \u0432 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f\u0445 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u044d\u0442\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0448 <code>middleware<\/code> \u0432 \u043a\u043e\u043d\u0435\u0446 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430(pipeline), \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0441\u043b\u0435 <code>Run<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u043e.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0420\u0435\u0431\u044f\u0442\u0430 \u0438\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u044b ASP.NET \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 <del>\u043b\u0443\u0447\u0448\u0438\u0445<\/del> \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0442\u044c <code>middleware<\/code> \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u0441\u0432\u043e\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f(extension method).<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 <code>BasicAuthMiddleware<\/code> \u0441 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c <code>Invoke<\/code><\/p>\n<pre><code class=\"cs\">\/\/\u041d\u0435 \u043f\u044b\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0432 production public class BasicAuthMiddleware     {         private readonly RequestDelegate _next;         public BasicAuthMiddleware(RequestDelegate next)         {             _next = next;         }          public async Task Invoke(HttpContext context)         {             if (context.Request.Headers[&quot;Authorization&quot;] == &quot;Basic aGFicmE6aGFicg==&quot;)             {                 context.Response.StatusCode = 200;                 await _next.Invoke(context);             }             else             {                 context.Response.StatusCode = 401;                 context.Response.Headers.Add(&quot;WWW-Authenticate&quot;, &quot;Basic realm=\\&quot;localhost\\&quot;&quot;);             }         }     } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 <code>BasicAuthMiddlewareExtension<\/code><\/p>\n<pre><code class=\"cs\">public static class BasicAuthMiddlewareExtension     {         public static IApplicationBuilder UseBasicAuth(this IApplicationBuilder builder)         {             return builder.UseMiddleware&lt;BasicAuthMiddleware&gt;();         }     } <\/code><\/pre>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 <code>Startup<\/code> \u043a\u043b\u0430\u0441\u0441\u0435:<\/p>\n<pre><code class=\"cs\">public class Startup     {         public void ConfigureServices(IServiceCollection services)         {         }          public void Configure(IApplicationBuilder app)         {             app.UseIISPlatformHandler();              app.UseBasicAuth();              app.Run(async (context) =&gt;             {                 await context.Response.WriteAsync(&quot;Hello World&quot;);             });         }     } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043e\u043a\u043d\u043e \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\"  width=\"650\" src=\"https:\/\/habrastorage.org\/files\/4a4\/9d7\/2fe\/4a49d72fe76c45ddb55eed7eca5dbf80.png\"\/><\/div>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u0432\u0435\u0434\u0435\u043c \u0432\u0435\u0440\u043d\u044b\u0439 \u043b\u043e\u0433\u0438\u043d \u2014 habra, \u043f\u0430\u0440\u043e\u043b\u044c \u2014 habr, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c <em>Hello World<\/em>. \u0412\u043e\u0442 \u0442\u0430\u043a, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 <code>middleware<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 OWIN. \u0423\u0432\u0438\u0434\u0435\u043b\u0438 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 pipeline \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u043b\u0435\u0434\u0443\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c Microsoft.<\/p>\n<h3>\u0410\u0432\u0442\u043e\u0440\u0430\u043c<\/h3>\n<p>  \u0414\u0440\u0443\u0437\u044c\u044f, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u0441\u0432\u043e\u0438\u043c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u043c, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u0435 \u043d\u0430 <a href=\"mailto:vyunev@microsoft.com\">vyunev@microsoft.com<\/a> \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0435\u0442\u0430\u043b\u0438. \u041c\u044b \u0440\u0430\u0437\u044b\u0441\u043a\u0438\u0432\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e ASP.NET \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0435\u043c\u044b.<\/p>\n<p>  <img decoding=\"async\" align=\"right\" width=\"200\" src=\"https:\/\/habrastorage.org\/files\/476\/344\/045\/4763440451c24874a21d0f2cd0934e9e.png\"\/><\/p>\n<h3>\u041e\u0431 \u0430\u0432\u0442\u043e\u0440\u0435<\/h3>\n<p>  <b>\u0411\u043e\u0431\u0438\u043a \u0412\u044f\u0447\u0435\u0441\u043b\u0430\u0432 \u0411\u043e\u0440\u0438\u0441\u043e\u0432\u0438\u0447,<\/b><br \/>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a .NET \u0432 Radario<\/p>\n<p>  \u041c\u043e\u043b\u043e\u0434\u043e\u0439 .Net \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u0441 3 \u0433\u043e\u0434\u0430\u043c\u0438 \u043e\u043f\u044b\u0442\u0430. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 ASP.NET MVC, \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f Windows \u0438 Windows phone.        \t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u0412\u0430\u0448 \u043e\u043f\u044b\u0442 \u0441 OWIN:<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"275817\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"14515\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71049\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71049\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71049\">\u0423\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71051\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71051\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71051\">\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u044e<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71053\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71053\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71053\">\u0417\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d, \u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71055\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71055\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71055\">\u041f\u043e\u043a\u0430 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"total\">\u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b 1 \u0447\u0435\u043b\u043e\u0432\u0435\u043a. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<\/p><\/div>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/275817\/\"> https:\/\/habrahabr.ru\/post\/275817\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<blockquote><p><i>\u041c\u044b \u0440\u0430\u0434\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0438\u0437 \u0441\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 ASP.NET Core (\u0440\u0430\u043d\u0435\u0435 ASP.NET 5). \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0412\u044f\u0447\u0435\u0441\u043b\u0430\u0432 \u0411\u043e\u0431\u0438\u043a \u2014 .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Radario, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0441\u0432\u043e\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u043e\u043c \u043f\u0440\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439 OWIN, Katana \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b. \u0412\u0441\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0446\u0438\u043a\u043b\u0430 \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0442\u0443\u0442 <a href=\"https:\/\/habrahabr.ru\/search\/?q=%5B%23aspnetcolumn%5D&amp;target_type=posts\">#aspnetcolumn<\/a> \u2014 \u0412\u043b\u0430\u0434\u0438\u043c\u0438\u0440 \u042e\u043d\u0435\u0432<\/i><\/p><\/blockquote>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0440\u0438\u0438<\/h3>\n<p>  \u0412 \u0434\u0430\u043b\u0435\u043a\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430, \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f ASP.NET MVC \u0432\u0435\u0440\u0441\u0438\u0438 CTP, \u043d\u0438\u043a\u0442\u043e \u0438 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0441\u044f, \u043e \u043a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043e\u0441\u0442\u0438, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0434\u043e\u0440\u043e\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0444\u0440\u0435\u0439\u0432\u043e\u0440\u043a\u0435, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 IIS, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0432\u044d\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u041e\u0421.  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" width=\"650\"  src=\"https:\/\/habrastorage.org\/files\/ffa\/815\/656\/ffa815656ced4d5c8a3933015758f802.png\"\/><\/div>\n<p>\u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c, \u0431\u043e\u0433\u0430\u0442\u0441\u0442\u0432\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 ASP.NET MVC \u0440\u043e\u0441\u043b\u043e, \u0440\u043e\u0441\u043b\u0430 \u0438 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <em>System.Web<\/em>, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0444\u0440\u0435\u0439\u043c\u0444\u043e\u0440\u043a \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u0432\u043e\u0440\u043a \u0441\u0442\u0430\u043b \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u043f\u043e\u0447\u0442\u0438 \u043f\u0440\u0438\u0431\u0438\u0442\u044b\u043c \u0433\u0432\u043e\u0437\u0434\u044f\u043c\u0438 \u043a IIS.<\/p>\n<p>  \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0431\u044b\u043b ASP.NET Web API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0438\u043c\u0435\u043b \u043f\u0440\u044f\u043c\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u0439\u043b\u044c IIS, \u0438 \u043c\u043e\u0433 \u0445\u043e\u0441\u0442\u0438\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0435\u0437 IIS(self-hosting). \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043a \u0440\u0435\u0431\u044f\u0442\u0430\u043c \u0438\u0437 Microsoft \u043f\u0440\u0438\u0448\u043b\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u0435\u043d \u0438\u043d\u0441\u0442\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u044d\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 .Net \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 IIS, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u044d\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0442\u044c \u0433\u0438\u0431\u043a\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0412 \u0438\u0442\u043e\u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f OWIN \u0438 \u043f\u0440\u043e\u0435\u043a\u0442 Katana.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-272801","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=272801"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272801\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=272801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=272801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=272801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}