0

I'm making an application in C# with VS 2012 that checks a database every 15 seconds and perform some actions when it finds data. Right now I've created a Console Application so I can debug it easely but during relese this application needs to run in a IIS server.

How can I do that? I've read this question but it looks like some sort of workaround because to run it I need to perform these steps. Right now I'm reading the docs about Windows Service Application, Is this the right way?

EDIT Sorry but I've never used Windows server before, so as people pointed out IIS is only a web server, the thing I need to do is run my application in a Windows Server environment

2 Answers 2

1

IIS is a web-server and accordingly it should be used for hosting web applications.

Develop a windows service which does the job of checking the database in intervals and invoke a web service (which you can host in IIS)

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah thank you I've just realized IIS is only a web-server. So I think a windows service is the way to go
@Federico: Yup, but you should know that it can also host console applications though it is not designed for that.
1

If your application is performing some data query and manipulation on the server then I would recommend the approach to host it in a windows service.

Some advantages to this are:

  • The service will start and run independently of a user logging into the server.
  • You can configure the service to recover should it experience an exception (ideally not!).
  • The service will start automatically (if configured) when the server restarts.
  • You can configure which user group (or user) the service should run under so you have a more granual approach to security.
  • As it's running as a seperate process, you can monitor its memory and processor utilisation.

Debugging is slightly more cumbersome but not difficult, one approach I've used is to install the service locally, start it and then attach to it via the debugger. This question describes another approach I've also used.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.