1

当我尝试使用为AppFabric beta 2 托管的文件svcutil生成客户端代理时收到以下错误消息:xamlx

两个不同的合约具有相同的 ConfigurationName

我理解该消息,但是,我找不到它的原因或如何解决它。我正在学习 VS2010RC 培训套件中的“工作流程服务简介”实验室。Web 应用程序有两个服务:SubmitApplication.xamlx 和 EducationScreening.xamlx。我不知道为什么,但他们都有四个端点。如果我通过 IIS Mgmt Studio 中的 AppFabric 仪表板查看:

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))

在浏览器中查看 SubmitApplication.xamlx 时,我看到以下堆栈跟踪:

[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

谁能告诉我我做错了什么?

我自己没有配置任何绑定。BasicHttpBinding 是在 .NET 4 中在 Web 应用程序中托管服务时默认获得的。其他绑定由 AppFabric 配置。我在任何地方都找不到他们的配置。

更新:删除了其中一项 xamlx 服务 ( EducationScreening.xamlx)。没有效果。

亲切的问候,
罗纳德·维尔登伯格

4

1 回答 1

4

我做了一些进一步的研究,我发现了问题。SubmitApplication.xamlx 工作流中有两个 ReceiveRequest 活动。他们有两个不同的 ServiceContractName:

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

但是,我仍然不明白该消息。xamlx 服务的 ConfigurationName 是什么?为什么当我更改 ServiceContractName 时会有所不同?

于 2010-03-09T05:51:55.997 回答