What would be reasons that you want to host a wcf service in a windows service and not in IIS?
+3
A:
One reason is that IIS6 only supports bindings based on HTTP. If you want to use TCP, MSMQ, etc., then you need to host in a separate program.
John Saunders
2010-02-09 02:56:50
+1
A:
- Freedom. You as the developer don't need someone to administer the box
- Sometimes IIS6 is really just overkill
- You are using it as interprocess communication conduit
- You wish to declare all of the bindings in code. This is far less confusing and more powerful than the xml config files that seem to be all the rage. I can't envision many scenarios where I would want a non-programmer messing with bindings. The xml approach is fine for prototyping and systems that need to be highly dynamic, but overall I don't think its a good idea
Steve
2010-02-09 03:10:45
@Steve: XML config files are a really good idea when the programmer needs to fix the bindings in production. It's not then necessary to deploy a new version of the binaries.
John Saunders
2010-02-09 03:22:07
@John: My main opposition to them is that it blurs the problem domain. Configuration problems should be handled by IIS admins, and code problems should be handled by programmers. When you have a file defining the bindings, it looks to the admin like its their domain, when it most clearly is not. Also, there were several settings that were very hard to define in xml with the 3.5 version of the framework and I had to do it in code. Not really sure if that will improve in 4.0
Steve
2010-02-09 15:23:39
+2
A:
- When hosting in IIS you are only allowed to bind to a single port per a base address, in each web site (Meaning you cant specify two bindings with different ports since you can only use a single port, or endpoints that use different ports)
- You can only use a single base address in IIS, the only way around this is deploying multiple versions of the same project in different websites (yuck)
- The IIS process must recycle eventually, and when it does it dumps everything and restarts, which is good alot of the time since memory is freed and trapped resources are released, but when using singletons this can have an undersired effect depending on your code
[edit] : more points
- In a standard setup your worker process always have 2GB Virtual memory available (no matter if you have 1, 2 or 4GB physical memory in the machine).
Neil
2010-02-09 12:30:09