views:

789

answers:

2

I'm getting

Validation (): Attribute 'Factory' is not a valid attribute of element 'ServiceHost'.

from VS2008 in an empty WCF Service Application after I add Factory="System.ServiceModel.Activation.WebServiceHostFactory" to the @Service directive in the .svc file. I've added System.ServiceModel.Web reference to the code-behind.

I'm at a total loss based on what I've read on MSDN. Has anybody come across this before?

Update:

Factory doesn't even show up as an available attribute in the intellisense in the markup for the .svc file.

+1  A: 

Make sure you have a reference to System.ServiceModel in the code behind. Unless you have an explicit factory object, you don't need a reference to it. I have a host in an IIS hosted service that looks like this:

<%@ ServiceHost Service="Donaghe.ManualWCF.CalculatorService" %>

That's all you really need. Make sure that what goes into the service attribute is the full name of your service class.

Let me know if that helps.

Terry Donaghe
I do have a reference to System.ServiceModel in the code behind. And, I want to use WebServiceHostFactory so that I don't have to edit the web.config to set up the endpoints manually. I'm planning on hosting the service in IIS. Thanks for the help though :)
Neil D
And, yes I have the fully qualified name of the service specified.
Neil D
+2  A: 

I had .NET 3.5 installed but I didn't have SP1 installed for Studio 2008. Ugh.

Neil D
D'oh! That'll do it. Been there. Done that.
Terry Donaghe