ASP .NET应用程序与Windows服务 [英] ASP .NET Application vs. Windows Service

查看:55
本文介绍了ASP .NET应用程序与Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示信息的ASP .NET Web应用程序。在

的同时,我有一个Web服务,它从各种

客户端应用程序中收集信息。这些数据需要以多种方式连续处理并存储在数据库中。我需要计时器轮询数据

并对其进行处理并写入数据库。我需要将大量的

数据缓存为内存中的对象,因为它一直在使用。我需要从数据库中的数据生成每周报告。


我的问题是这个。我可以在ASP .NET中完成所有这些操作,还是需要

一个Windows服务?我可以保持我的网络应用程序活着并且所有

计时器都可以工作吗?有没有人以前做过这个,实际上用这样的ASP .NET

应用程序?


谢谢


马克

解决方案

" Untitled" <毫安******* @ hotmail.com>新闻中承认:1107989521.867262.17080

@ l41g2000cwc.googlegroups.com:

我有一个显示信息的ASP .NET Web应用程序。在
同时,我有一个Web服务,从各种客户端应用程序收集信息。这些数据需要以多种方式连续处理并存储在数据库中。我需要计时器来轮询数据并对其进行处理并写入数据库。我需要将大量的数据缓存为内存中的对象,因为它一直在使用。我需要根据数据库中的数据生成每周报告。

我的问题是这个。我可以在ASP .NET中完成所有这些吗?还是我需要一个Windows服务?我可以保持我的Web应用程序活着并且所有定时器都在工作吗?有没有人以前这样做过,实际上是用这种方式使用了ASP .NET
应用程序?

Mark



你可以这样做。


但是,如你所述,你的数据源支持webservice协议(即

SOAP),并且在接收器上没有用户交互,那么你可能想要实现作为web服务。


- ipgrunt


对于您所描述的重要的定时后台任务,Windows服务是这个工作的最佳工具。你可能会哄骗ASP.NET做这件事,

但这有点像试图将方形钉子放入圆孔中。


-

我希望这会有所帮助,

Steve C. Orr,MCSD,MVP
http://SteveOrr.net

" Untitled" <毫安******* @ hotmail.com>在消息中写道

news:11 ********************* @ l41g2000cwc.googlegro ups.com ...

我有一个显示信息的ASP .NET Web应用程序。在
同时,我有一个Web服务,从各种客户端应用程序收集信息。这些数据需要以多种方式连续处理并存储在数据库中。我需要计时器来轮询数据并对其进行处理并写入数据库。我需要将大量的数据缓存为内存中的对象,因为它一直在使用。我需要根据数据库中的数据生成每周报告。

我的问题是这个。我可以在ASP .NET中完成所有这些吗?还是我需要一个Windows服务?我可以保持我的Web应用程序活着并且所有定时器都在工作吗?有没有人这样做过,实际上是用这种方式实现了ASP .NET
应用程序?

Mark





" Steve C. Orr [MVP,MCSD]" <圣*** @ Orr.net>在留言中写道

news:ex **************** @ TK2MSFTNGP09.phx.gbl ...

对于重要时间如你所描述的后台任务,Windows服务是这项工作的最佳工具。你可能会哄骗ASP.NET去做它,但这有点像试图将方形钉固定在一个圆形孔中。



我希望有一种简单的方法可以在IIS中执行此操作,因为它会强制您在两个进程中运行代码或使用远程处理来使用



如果您的网站不需要IIS的安全性和其他服务,那么您可以在服务中托管ASP.NET。目前您还必须提供一个

HTTP服务器,但您可以为此下载Cassini。只需在

中添加一个对Cassini.dll服务的引用,并启动服务器一个未使用的

选择端口。

http://www.asp.net/ Projects / Cassini / ... ndex = 0& tabid = 1

在.NET 2.0中,您将能够使用IIS使用的相同HTTP服务器堆栈。 />
在您选择的过程中。因此,您将拥有IIS的所有性能和安全性,而无需在IIS下运行您的应用程序。

http://msdn.microsoft.com/msdnmag/is...n/default.aspx


David


I have an ASP .NET web application that displays information. At the
same time, i have a web service that collects information from various
client applications. This data needs to be processed continuously in
many ways and stored in the database. I need timers to poll the data
and process on it and write to the database. I need to have lots of
data cached as objects in memory as it is being used all the times. I
need to generate weekly reports from data in the database.

My question is this. Can I do this all in ASP .NET or do I need to have
a windows service? Can i keep my web application alive and all the
timers working? Has anyone done this before, actually used an ASP .NET
Application in this way?

Thanks

Mark

解决方案

"Untitled" <ma*******@hotmail.com> confessed in news:1107989521.867262.17080
@l41g2000cwc.googlegroups.com:

I have an ASP .NET web application that displays information. At the
same time, i have a web service that collects information from various
client applications. This data needs to be processed continuously in
many ways and stored in the database. I need timers to poll the data
and process on it and write to the database. I need to have lots of
data cached as objects in memory as it is being used all the times. I
need to generate weekly reports from data in the database.

My question is this. Can I do this all in ASP .NET or do I need to have
a windows service? Can i keep my web application alive and all the
timers working? Has anyone done this before, actually used an ASP .NET
Application in this way?

Thanks

Mark



You can do it either way.

But, if as you describe, your data source supports webservice protocols (ie,
SOAP), and there is to be no user interaction at the receiver, then you''d
probably want to implement as a webservice.

-- ipgrunt


For important timed background tasks as you describe, a Windows Service is
the best tool for the job. You might be able to coax ASP.NET into doing it,
but it would be a bit like trying to fit a square peg into a round hole.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Untitled" <ma*******@hotmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...

I have an ASP .NET web application that displays information. At the
same time, i have a web service that collects information from various
client applications. This data needs to be processed continuously in
many ways and stored in the database. I need timers to poll the data
and process on it and write to the database. I need to have lots of
data cached as objects in memory as it is being used all the times. I
need to generate weekly reports from data in the database.

My question is this. Can I do this all in ASP .NET or do I need to have
a windows service? Can i keep my web application alive and all the
timers working? Has anyone done this before, actually used an ASP .NET
Application in this way?

Thanks

Mark




"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:ex****************@TK2MSFTNGP09.phx.gbl...

For important timed background tasks as you describe, a Windows Service is
the best tool for the job. You might be able to coax ASP.NET into doing
it, but it would be a bit like trying to fit a square peg into a round
hole.



I wish there was an easy way to do this in IIS, since it forces you to
either run your code in two processes or use remoting.

If you web site is doesn''t need the security and other services of IIS you
could host ASP.NET inside your service. Currently you must also supply an
HTTP server, but you can download Cassini for this. Just add a reference in
your service to Cassini.dll and start a server an unused port of your
choice.

http://www.asp.net/Projects/Cassini/...ndex=0&tabid=1

In .NET 2.0 you will be able to use the same HTTP server stack that IIS uses
in a process of your choice. So you will have all the performance and
security of IIS, without having to run your application under IIS.

http://msdn.microsoft.com/msdnmag/is...n/default.aspx

David


这篇关于ASP .NET应用程序与Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆