Why would you host the wcf service in a windows service?

What would be the reasons why you want to host the wcf service in a Windows service and not in IIS?

+4
source share
3 answers

One reason is that IIS6 only supports HTTP-based bindings. If you want to use TCP, MSMQ, etc., you need to place it in a separate program.

+3
source
  • When hosted on IIS, you are allowed to bind only one port to a base address on each website (assuming you cannot specify two bindings with different ports, since you can only use one port or endpoints that use different ports)
  • You can use only one base address in IIS, the only way is to deploy several versions of the same project on different sites (yuck).
  • The IIS process should ultimately be reworked, and when it does, it resets everything and restarts, which is a good long time from freeing up memory and freeing up captured resources, but when using singletones this can have a reduced effect depending on your code

[edit]: more points

  • In the standard setup, your workflow always has 2 GB of virtual memory available (regardless of whether you have 1, 2 or 4 GB physical memory in the machine).
+2
source
  • Liberty. You, as a developer, do not need someone to manage the box
  • Sometimes IIS6 is really just a brute force
  • You use it as an intermediate communication channel
  • You want to declare all bindings in the code. This is much less confusing and powerful than the xml configuration files that seem to be all the rage. I can’t imagine many scenarios where I would like a non-programmer to mess with bindings. The xml approach is great for prototypes and systems that need to be very dynamic, but overall I don't think this is a good idea.
+1
source

Source: https://habr.com/ru/post/1300695/


All Articles