ASPNET WebApi服务器三种承载方式:SelfHosting,IIS Hosting, WinService Hosting
作者:作者不详  发布日期:2020/02/17 22:51:34
  ASPNET WebApi服务器三种承载方式:SelfHosting,IIS Hosting, WinService Hosting

ASPNET WebApi服务器三种承载方式:SelfHosting,IIS Hosting, WinService Hosting-csframework_知识库文档


1. Win服务承载(Windows Service Hosting宿主)


Running your api as Windows services can have multiple advantages, especially when working on bigger projects. This allows for multiple services to run in isolation and gives fine grained control over your system components.

ASP.NET Web API ships with self-hosting feature that allows to run HTTP service outside of IIS. This can be easily used in Windows services. In this blog post I am going to show how to host Web API service inside of Windows service, using both Windows Service Visual Studio project template andTopshelf library.


将WebApi作为Windows服务运行有多种优势,特别是在处理更大的项目时允许多个服务独立运行,并且对系统组件能进行粒度控制。

ASP.NET Web API附带自托管(Self Hosting)功能,允许在IIS之外运行HTTP服务,在Windows服务中很容易使用。

参考文章:

C# ASP.NET WebApi服务器搭建详解 - Win服务承载(Windows Service Hosting宿主)


2. IIS服务承载(IIS Hosting IIS宿主)



Internet Information Services (IIS)

IIS is the acronym for Internet Information Services. It is the set of feature extension modules that are created by Microsoft. IIS is an integral part of the Windows Server products. It supports the Hyper Text Transfer Protocol (HTTP), File Transfer Protocol (FTP), Simple Mail Transfer Protocol (SMTP) etc. IIS is not turned on automatically when Windows is installed.

Benefits of IIS Hosting

When we host the Web API in IIS , it is deployed and managed like other IIS applications.
When we host the application on IIS, it can provide the process activation and recycling capabilities that increase the reliability of the hosted application.
The Web API is hosted on IIS, that simplifies the development and deployment of hosted services.
Now I will define the procedure of hosting the Web API on an IIS server.

//来源:C/S框架网(www.csframework.com) QQ:23404761


使用Internet Information Server互联网信息服务(IIS) 寄宿WebApi服务器,要确保你的电脑是否安装IIS。

IIS是Internet信息服务的缩写。它是由Microsoft创建的一组特性扩展模块。IIS是Windows服务器产品的一个组成部分。它支持超文本传输协议(HTTP),文件传输协议(FTP),简单邮件传输协议(SMTP)等。安装Windows时,IIS不会自动打开。

IIS托管的好处:

当我们在IIS中托管Web API时,它像其他IIS应用程序一样被部署和管理。
当我们将应用程序托管在IIS上时,它可以提供进程激活和回收功能,从而提高托管应用程序的可靠性。
Web API托管在IIS上,这简化了托管服务的开发和部署。


参考文章:

C# ASP.NET WebApi服务器搭建详解 - IIS服务承载(IIS Hosting IIS宿主)



3. 自承载,自托管(Self Hosting)

Self Hosting是指ASP.NET WebAPI运行在一个控制台应用程序中,使用OWIN组件托管WebAPI框架。

Open Web Interface for .NET (OWIN) 定义了.Net Web服务器和Web应用程序之间的抽象逻辑。

OWIN将Web应用程序与服务器解耦,OWIN非常适合在IIS之外的自己的进程中自托管Web应用程序。

自托管意味着运行我们的ASP.NET Web API项目在我们自己的Web服务器上而不是使用IIS。



参考文章:

C# ASP.NET WebApi服务器搭建详解 - 自承载(Self Hosting)





.NET WebApi开发框架|MVC框架|后端框架|服务端框架-标准版V1.0

适用开发 适用开发:快速构建支持多种客户端的服务端程序,支持APP、B/S、C/S跨平台移动终端等。
运行平台 运行平台:Windows + .NET Framework 4.5
开发工具 开发工具:Visual Studio 2015+,C#语言
数据库 数据库:Microsoft SQLServer 2008R2+(支持多数据库:Oracle/MySql)


WebApi服务端开发框架


     CSFramework.WebApi是服务端快速开发框架(后端框架),借助ASP.NET WebAPI底层架构的强大编程能力,封装成为可复用的以及可定制开发的服务端软件模板,CSFramework.WebApi提供可复用的软件架构和开发包,为用户快速轻松搭建基于HTTP协议、HTTPS协议以及支持多种客户端(如:APP、B/S、C/S、微信公众号、微信小程序等)各种跨平台移动终端的服务端应用程序。

    服务端应用开发、后端接口开发是软件项目重要工作环节,服务端注重业务逻辑、数据处理和数据分析、算法等方面的设计和服务,前端主要体现在用户体验、界面操作和数据采集方面。前端软件系统和后端服务架构共同搭建跨平台大型数据管理应用系统。


扫一扫加微信:
 


上一篇 下一篇