tags:

views:

57

answers:

3

I have a web site and build a wcf service in it. I can run the code by calling it from a test page in the web site. The web site is ran by the vs2010 development server.

I do have IIS 7 but never use it.

Now I want to use the NetTcpBinding instead of BasicHttpBinding, everyone says it should be enabled in IIS, but how can this be done without using IIS and keeping everything in 1 project?

Thanks for any help

edit: A Windows service would be a solution, but that would mean adding a project to the solution, I really want to keep everything in 1 website, took me quite some time to get the service in the website in the first place.

This is about my own test version of the website, the production server is out of my reach. The service must be expanded by other developers later on it's bad if they have to run IIS just to test the service.

+2  A: 

One way is to host the WCF service in a Windows Service - see How to: Host WCF in a Windows Service Using TCP for sample code.

Stuart Dunkeld
Thanks for the suggestion, but I'd rather keep everything in 1 solution.
MrFox
It *can* be within the same solution.
Sohnee
A: 

Are you talking about how to develop without using IIS7 or how to put the service into a production environment without IIS7?

If it's the latter, then Stuart's answer is correct, but otherwise I would suggest that you start to develop using the web server that you will eventually be hosting the web site/service on.

Hosting in IIS7 has several advantages over hosting in a Windows Service such as fault tolerance and process isolation already built in.

starskythehutch
The production server is out of my reach, I have a test version of the entire website and database on my own PC to screw around on :)But later on other developers must also be able to modify the web service, it's bad when they have to use IIS just to test the web service.
MrFox
starskythehutch
ok, but how about the delay after some idle time (see this posthttp://blogs.msdn.com/b/wenlong/archive/2010/02/11/why-does-wcf-become-slow-after-being-idle-for-15-seconds.aspx), how to use it in WAS. i tried using "AppInitializer.cs" but didn't work.
ashraf
I think that's probably the subject of another question. I never said it was perfect :)
starskythehutch
A: 

Thanks for the replies guys, it looks like I have 3 options: 1. Host the service in a seperate project. 2. Host the website in IIS. 3. Use HTTPS, also secure.

PS: My development environment is very different from production :( In development I have unit testing and in production there are old ASP pages, that I can't even acces, but sometimes must refer to...

MrFox