13 September, 2009
Trying to host more than one WCF-services on a remote hosted IIS; I today encountered this problem when trying to open the second service:
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item
WCF services hosted in IIS can have only one baseaddress. So to mitigate that problem, you have to create a custom service factory to intercept and remove the additional unwanted base addresses that IIS is providing. A generic factory capable of handling any service type is seen here:
public class GenericServiceHostFactory : ServiceHostFactory
protected override ServiceHost CreateServiceHost(Type serviceType, Uri baseAddresses)
//return the first...
return new ServiceHost(serviceType, baseAddresses);
You configure it in your service configuration files (myservice.svc) by means of the Factory attribute on the ServiceHost tag:
<%@ Assembly Name="services.ckit.dk" %>
In this way – you handle the service construction yourself and do not leave it to the WCF-pipeline.
10 September, 2009
Having used RSSBandit for a while (it is .NET based!), I’ve tonight shifted into using NewsGators FeedDemon. Wow – are you in for an intuitive and positive experience.
I can only recommend this RSS-reader!
This bit me! Having made some changes to an iPhone application (Obj-C); everything worked fine in the simulator. But, when deploying the s...
I recently did a short table on the bizarre keyboard mapping on a Macbook Pro, when running Windows on such creature. Well – it turns out th...
It has really proven a difficult task to find a simple (and understandable) example on how to perform XAML-databinding to a Hierarchical tre...
This post details how you can customize the way users of your WCF-services are authenticated. But, before engaging in this procedure, let’s ...