开发者

Running a .NET Program as a Background Service

开发者 https://www.devze.com 2023-01-26 23:54 出处:网络
Here is the simple scenario that I want to apply; There is a .NET application(console or w开发者_开发问答indows) appA and this code updates a large global variable(+50MB) in the project every 30sec.

Here is the simple scenario that I want to apply;

  1. There is a .NET application(console or w开发者_开发问答indows) appA and this code updates a large global variable(+50MB) in the project every 30sec.
  2. I have another application appB which is a .NET web application and I want to be able to access the updated value of global variable in appA from appB whenever I want.

What do you suggest to me for this purpose?


My initial thoughts are to have application A run as a windows service and have that write to some shared location for the web application.


Flat file, database, remoting, or sockets are some ways you can do it. The answer would vary based on certain factors, such as whether or not the data is sensitve, how many computers you plan on distributing the app to, and whether or not multiple instances of appA could exist.


If the 2 are running on the same machine, you can use the Registry or Store it on a file or database.

If it may run on different machine database might be the best alternative.

0

精彩评论

暂无评论...
验证码 换一张
取 消