Andrej Slivko
Andrej Slivko

Reputation: 1256

How to structure WCF web service solution so it would be easy to develop and host in different ways?

I'm about to start building WCF web service, and i would like to structure solution in such way that is would be:

  1. Easy to develop - i would like so that developers on my team could just get sources, build, and start service, probably best would be to have possibility to start it as console app?

  2. Easy to host this service later in IIS, WAS or windows service.

I was thinking about having this projects:

Will there be any problems with such approach? What could be things that i should consider in advance? Maybe there is better structure?

I would appreciate any insights and links to resources that could help me chose right structure.

p.s. web service itself is simple, but this approach would be reused for more services.

Upvotes: 2

Views: 1121

Answers (2)

Johann Blais
Johann Blais

Reputation: 9469

With this information, I say this structure looks fine.

You might also consider creating a separate ServiceModel assembly to store all your custom behavior and WCF. They could then be reused for other projects

Upvotes: 0

Xhalent
Xhalent

Reputation: 3944

What I tend to do is to place all my interface definitions in one assembly/project, all the service implementations in another assembly project, and the hosting environment, whether it be console, IIS (ie the .svc files) or windows service or whatever, in a separate assembly.

Upvotes: 6

Related Questions