Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have a scenario where I have a window service running. Whenever, a specific exception occurs in my asp.net web, I call window service or send a message to my window service from asp.net web and window service generates an email on receiving that message. What would be the best best solution for this scenario. Should I use some kind of wcf service or shared database. Please guide me in this regard.
Posted

As you see the alternatives right, and we don't have insight in your system, you have to decide.
You can use anything as IPC that suites your needs, but choose the one that costs the less, and solves the most. Direct IPC is best when the reaction needs to be on time, while indirect IPC (like shared files or common database) is better when you don't need quick handling, but a queue is good to have. I am usually implementing table based queue in such mail-sending scenarios. It is easy to implement. Though, I have developed a simple MSMQ based solution with the same purpose. You can see it here: Using MSMQ in mail relay[^].
 
Share this answer
 
You can use NLog, to save logs in text files and sql server databases. Next you can use windows service to read this last entries and send it using email server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900