I guess there are many ways to achieve this. Here are a several that spring
to mind (there are many, many more).
1) Write a request into a database table. Another process can poll the
table, pick up new requests, and handle them.
2) Use MSMQ (or Queued Components). Another process can wait on the queue,
and handle the request.
3) Put the request into a file, and drop in a specific folder. You can use a
file system watcher in another process to handle the request.
4) Use a asyncronous Remoting call to another process.
Basically, use some form of IPC to pass a message to another process.
Obviously, the other process will have to persist the result back somewhere,
to be collected by the ASP.NET application (if and when the user returns).
You'll need to pick one you are comfortable coding up, and that matches you
specific task.
Two ways I would not particularly recommend:
a) Start the work in a thread in the ASP.NET process. This could cause a
multitude of stability/security/performance problems.
b) Start up another process specifically to do the work. The problem here is
that if 100 users all come along at once, you'll go and start 100 process,
which will all compete for the same resources.
Nick.
Marc said:
I want to write a C#/ASP.NET application where a user can go to a web
page, start running a job, close their browser, and then come back later and
see the results. The purpose for this application is for a user to be able
to use a page on our intranet to start running a time-consuming reporting
and analysis job. I'm not sure how to start a process in ASP.NET and then
"detach" it, or how to check that it's still running later. I think that
maybe the best way to do this is COM+? I would appreciate any pointers on
where to get started!