30 Jan, 2009
Running WCF on GoDaddy
Posted by: eip In: Tech
GoDaddy and many ASP.NET hosting company operate IIS under medium trust. As such, you will need to make a number of modifications to your app.config/web.config to make WCF work. Assuming your WCF service is compiled against the 3.5 framework, the following is a list of errors I encountered along the way and the respective solution.
There is no build provider registered for the extension ‘.svc’. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value ‘Web’ or ‘All’.
<compilation> <buildProviders> <add extension=".svc" type="System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </buildProviders> </compilation>
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
<system.serviceModel> ... <serviceHostingEnvironment> <baseAddressPrefixFilters> <add prefix="http://services.edoverip.com/" /> </baseAddressPrefixFilters> </serviceHostingEnvironment> ... </system.serviceModel>
The WSHttpBinding with name WSHttpBinding failed validation because it contains a BindingElement with type System.ServiceModel.Channels.SymmetricSecurityBindingElement which is not supported in partial trust. Consider disabling the message security and reliable session options, using BasicHttpBinding, or hosting your application in a full-trust environment.
This one is a bit tricky. If you prefer to use wsHttpBinding, you will have to set the Security Mode to either None or Transport. For example, to set it to None, it looks something like this…
<bindings> <wsHttpBinding> <binding name="wsHttp"> <security mode="None" /> </binding> </wsHttpBinding> </bindings>
<services> <service behaviorConfiguration="DistanceWS.ServiceBehavior" name="DistanceWS.Service"> <endpoint binding="wsHttpBinding" bindingConfiguration="wsHttp" contract="DistanceWS.IService" /> <host> <baseAddresses> <add baseAddress="http://localhost:8731/Design_Time_Addresses/DistanceWS/Service/" /> </baseAddresses> </host> </service> </services>
That’s all I can think of for now. I will update this post if I come across anything else. Meanwhile, enjoy and good luck!