简体   繁体   English

IIS的.Net Web Application app启动工作流程

[英].Net Web Application app startup workflow for IIS

Okay, so let's say I have a web application that absolutely has to perform some kind of startup and has to remain running indefinitely regardless of the communication it receives from the clients (as it's a push based system) 好吧,让我们说我有一个绝对必须执行某种启动的Web应用程序,并且无论从客户端收到的通信如何都必须保持无限运行(因为它是基于推送的系统)

Now for testing I have been hosting this as a windows service, which is great because it allows for me to have a hard entry point to the application where I can do my bootstrapping and get the service up and running 现在进行测试我一直把它作为一个Windows服务托管,这很棒,因为它允许我有一个硬入口点到应用程序,我可以进行自举,并启动和运行服务

Next, I'm trying to move this into the IIS world instead so I can face this service to the outside world...and I've hit a snag...I don't have any hard entry point where I can bootstrap the application except for global.asax, which as I understand it is only invoked when the clients make a call to the server 接下来,我试图将其转移到IIS世界中,以便我可以面向外界使用这项服务......而且我遇到了麻烦......我没有任何难以进入的地方我可以引导除了global.asax之外的应用程序,据我所知,它仅在客户端调用服务器时调用

Is there a better area I can put an entrance to the application and get it bootstrapped without waiting for a client to connect to it? 有没有更好的区域我可以放入应用程序的入口并让它自动引导而无需等待客户端连接到它? And is this area only called once or is it going to be called periodically as the application falls out of scope (so to speak)? 这个区域只被调用一次还是会被定期调用,因为应用程序超出了范围(可以这么说)? Like I said, the app has to remain running at all times 就像我说的那样,应用程序必须始终保持运行状态

Is there a better area I can put an entrance to the application and get it bootstrapped without waiting for a client to connect to it? 有没有更好的区域我可以放入应用程序的入口并让它自动引导而无需等待客户端连接到它?

Yes, there is. 就在这里。 You can warm up IIS . 你可以热身IIS

And is this area only called once or is it going to be called periodically as the application falls out of scope (so to speak)? 这个区域只被调用一次还是会被定期调用,因为应用程序超出了范围(可以这么说)?

It depends which method in Global.asax you use. 这取决于您使用Global.asax中的哪种方法。 Application_Start runs once per app start. Application_Start每个应用程序启动运行一次。

Like I said, the app has to remain running at all times 就像我说的那样,应用程序必须始终保持运行状态

Beware, dragons here. 小心,龙在这里。 This depends how critical it is. 这取决于它的重要程度。 If you need utter reliability, you must use load balancer and have at least one other duplicate service. 如果您需要完全可靠性,则必须使用负载平衡器并至少具有一个其他重复服务。 Other things to consider, app pool needs to be recycled from time to time. 其他需要考虑的事项,应用程序池需要不时回收。 IIS, OS, your application have bugs, updates needs to be installed, network device fails, power outages do happen and so on. IIS,操作系统,您的应用程序有错误,需要安装更新,网络设备出现故障,停电确实发生等等。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 app.UseMigrationsEndPoint 在 .NET 核心 Web 应用程序启动 class 中的作用 - What app.UseMigrationsEndPoint does in .NET Core Web Application Startup class 在IIS上配置.net核心Web应用程序和webapi - Configuration .net core web application and webapi on IIS 在IIS上更新.NET Core Web App - Update .net core web app on iis 是否可以从上次成功构建IIS服务器应用程序池(生产)中运行Asp.net Web应用程序(Web窗体应用程序) - Is it possible to run an Asp.net web application (web forms app) from last successful build in IIS server app pool (production) 在.NET App中获取IIS应用程序名称 - Get IIS Application Name in .NET App 我应该使用工作流服务而不是让我的工作流作为 ASP.NET web 应用程序的一部分吗? - Should I use a workflow service rather than having my workflow as part of the ASP.NET web app? 运行 .net 核心应用程序作为 windows 应用程序并在 windows 启动时启动 - Run .net core app as windows application and start at windows startup 在 IIS 上启动 .NET Core Web API 时出错:“应用程序正在 IIS 进程内运行,但未配置为使用 IIS 服务器” - Error on starting .NET Core Web API on IIS: "Application is running inside IIS process but is not configured to use IIS server" IIS 6编译的Web应用程序上的ASP.NET路由 - ASP.NET routing on IIS 6 Compiled web application 运行 exe 的 ASP.NET Web 应用程序在 VS 中工作,而不是在 IIS 中 - ASP.NET Web application running an exe works in VS, not in IIS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM