元素'行为'有无效的儿童' transportClientEndpointBehavior'还有basicHttpRelayBinding

我在创建WCF配置文件时可能会在Visual Studio中出现此错误,因为VS编辑器不知道该扩展名。我需要知道在哪里放置transportClientEndpointBehavior,有什么帮助吗?谢谢。
 <behaviors>
  <endpointBehaviors>
    <behavior name="sharedSecretClientCredentials">
      <transportClientEndpointBehavior credentialType="SharedSecret">
        <clientCredentials>
          <sharedSecret issuerName="***********" issuerSecret="**********" />
        </clientCredentials>
      </transportClientEndpointBehavior>
      <ServiceRegistrySettings discoveryMode="Public"/>
    </behavior>
  </endpointBehaviors>
  ...
</behaviors>
我也遇到了basicHttpRelayBinding的问题,我认为它包含在绑定下。     
已邀请:
Windows Azure平台培训工具包中有一个示例,它以编程方式执行此操作。这是样本snippit ......
// create the service URI based on the service namespace
        Uri address = ServiceBusEnvironment.CreateServiceUri("sb",
                      serviceNamespaceDomain, "EchoService");

        // create the credential object for the endpoint
        TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior();
        sharedSecretServiceBusCredential.CredentialType = TransportClientCredentialType.SharedSecret;
        sharedSecretServiceBusCredential.Credentials.SharedSecret.IssuerName = issuerName;
        sharedSecretServiceBusCredential.Credentials.SharedSecret.IssuerSecret = issuerSecret;

        // create the service host reading the configuration
        ServiceHost host = new ServiceHost(typeof(EchoService), address);

        // create the ServiceRegistrySettings behavior for the endpoint
        IEndpointBehavior serviceRegistrySettings = new ServiceRegistrySettings(DiscoveryType.Public);

        // add the Service Bus credentials to all endpoints specified in configuration
        foreach (ServiceEndpoint endpoint in host.Description.Endpoints)
        {
            endpoint.Behaviors.Add(sharedSecretServiceBusCredential);
        }

        // open the service
        host.Open();
    
你安装了AppFabric SDK吗?
ServiceRegistrySettings
也应该是
serviceRegistrySettings
。     
Visual Studio Intellisense使用内置模式执行验证。因此,它不会 识别transportClientEndpointBehavior行为扩展,并将显示警告。 忽视这个警告。 答案来自“20487B-ENU-TrainerHandbook.pdf”,这是微软的官方课程书。第278页     

要回复问题请先登录注册