简体   繁体   中英

Run an application from the IIS application pool

I have a console application which basically sends emails once per day.

The Windows server administrator disallows this technique and doesn't want to allow extra software on the computer (launched by a scheduled task or a service).

I've been asked to evaluate the possibility of redeveloping a part of the application and integrate it into the IIS application pool but I don't think IIS can do this. Is it possible ? If so, how ?

The only approach I've looked at so far is to redevelop it as a web application and launch a web page everyday with a scheduled task, but I'd like to avoid that.

Let's analyze your options:

  1. Use task scheduler in your server to launch console app
  2. Use task schedule**r in your server to **web service hosted in IIS
  3. Have an IIS application running 100% of time in an infinite loop that that checks time every minute and if it happens to be the correct time send the emails
  4. Have a windows service .
  5. Use task scheduler in a different server to invoke

Analyzing each one of them:

  1. KO: Your administrator does not want console apps and process is not isolated.
  2. KO: You have process isolated but still you are installing a console app.
  3. OK : Not very good for performance but your fulfills your admin conditions.
  4. KO: Your admin does not want windows services.
  5. ?? : Probably your admin will not want to use an extra server

Proposed solution : As you can see only options 3 and 5 might pass the filter. Ask him

Correct solution I did similar things in the past and went for option 2. You have to convince your admin that solution 3 is a bad idea and probably 5 is already out of the question. When he had to choose the lesser of the evils option 2 is the best :-)

NOTE: You don't mention it but in case you have a SQL Server or similar you can store there an scheduled task too...

I had similar questions when I was moving from Apache servers (where it's dead easy to send a nightly email) to Windows (where you have options).

Clients have sometimes pushed me towards SQL Mail. It's not terrible. If your web app has a SQL backend, and it's okay to schedule things there, it's capable of sending emails when properly configured.

I don't think this is possible. With an IIS application you'd need something to trigger loading the application (call the web page). This itself would require a scheduled task.

You need to pound some sense into your administrator. Sorry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM