Error message: “Two different contracts have the same ConfigurationName” when downloading wsdl from xamlx in AppFabric beta 2

StackOverflow https://stackoverflow.com/questions/2392975

Question

I get the following error message when I try to use svcutil to generate a client proxy for a xamlx file that is hosted by AppFabric beta 2:

Two different contracts have the same ConfigurationName

I understand the message, however, I cannot find its cause or how to fix it. I'm following the 'Introduction to Workflow Services' lab from the VS2010RC training kit. The web application has two services: SubmitApplication.xamlx and EducationScreening.xamlx. I'm not sure why but both of them have four endpoints. If I take a look via the AppFabric Dashboard in IIS Mgmt Studio:

basicHttpBinding (Contract: *)
    (Type: Application(Default))
netNamedPipeBinding (Contract: System.ServiceModel.Activities.IWorkflowInstanceManagement)
    (Type: System (workflowControlEndpoint))
netNamedPipeBinding (Contract: *)
    (Type: Application (Default))
serviceMetadataHttpGetBinding (Contract: serviceMetadataHttpGetContract)
    (Type: System (serviceMetadataEndpoint))

When taking a look at the SubmitApplication.xamlx in a browser, I see the following stacktrace:

[InvalidOperationException: Two different contracts have the same ConfigurationName.]
System.ServiceModel.Activities.WorkflowServiceHost.CreateDescription(IDictionary`2& implementedContracts) +361
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +174
System.ServiceModel.Activities.WorkflowServiceHost.InitializeDescription(WorkflowService serviceDefinition, UriSchemeKeyedCollection baseAddresses) +82
System.ServiceModel.Activities.WorkflowServiceHost.InitializeFromConstructor(WorkflowService serviceDefinition, Uri[] baseAddresses) +206
System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory.CreateWorkflowServiceHost(WorkflowService service, Uri[] baseAddresses) +43
System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +974
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1423
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1132

[ServiceActivationException: The service '/HRApplicationServices/SubmitApplication.xamlx' cannot be activated due to an exception during compilation. The exception message is: Two different contracts have the same ConfigurationName..]
System.Runtime.AsyncResult.End(IAsyncResult result) +889824
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +179150
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107

Can anyone tell me what I'm doing wrong?

I haven't configured any of the bindings myself. The BasicHttpBinding is what you get by default in .NET 4 when hosting a service inside a web application. The other bindings are configured by AppFabric. I can't find their configuration anywhere.

Update: Removed one of the xamlx services (EducationScreening.xamlx). No effect.

Kind regards,
Ronald Wildenberg

Was it helpful?

Solution

I did some further research and I found the problem. There are two ReceiveRequest activities inside the SubmitApplication.xamlx workflow. They had two different ServiceContractName's:

{http://contoso.com/hr}IApplicationService
{http://contoso.com/hr/}IApplicationService

I still do not understand the message however. What is the ConfigurationName of a xamlx service? And why is it different when I change the ServiceContractName?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top