2012-02-21 2 views
3

"서비스 참조 추가"마법사를 사용하여 wcf 서비스 코드를 생성하는 중 오류가 발생했습니다.끝점은 Windows immersive 프로젝트의 버전 1과 호환되지 않습니다.

Custom tool warning: No endpoints compatible with version 1 of windows immersive project were found. C:\work\test_projects\CirMetro\Service References\SvcProxy\Reference.svcmap 1 1 CirMetro 

여러분은 그것을 고치는 방법을 알고 있습니까?

샘플 WCF 서비스는 간단합니다. 여기에 소스 코드가 있습니다 :

static void Main() 
{ 
    UiWcfSession.OnInitialize += ClientInitialize; 

    var baseAddresses = new Uri("net.tcp://localhost:9000/"); 

    var host = new ServiceHost(typeof(UiWcfSession), baseAddresses); 

    var reliableSession = new ReliableSessionBindingElement { Ordered = true, InactivityTimeout = new TimeSpan(24, 20, 31, 23) }; 
    var binding = 
     new CustomBinding(reliableSession, new TcpTransportBindingElement()) { ReceiveTimeout = TimeSpan.MaxValue }; 

    host.AddServiceEndpoint(typeof(IClientFulfillmentPipeService), binding, "svc"); 

    var metadataBehavior = new ServiceMetadataBehavior(); 
    host.Description.Behaviors.Add(metadataBehavior); 
    var mexBinding = MetadataExchangeBindings.CreateMexTcpBinding(); 
    host.AddServiceEndpoint(typeof(IMetadataExchange), mexBinding, "mex"); 

    host.Open(); 

    Thread.CurrentThread.Join(); 
} 

private static void ClientInitialize(int uiprocessid, string key) 
{ 
    Debug.WriteLine("ClientInitialize"); 
} 
+0

이 [기사] (http://blogs.msdn.com/b/piyushjo/archive/2011/10/19/wcf-for-metro-apps-supported-functionality.aspx) 이야기가있다 WPF Metro 응용 프로그램에서 지원되는 WCF 하위 집합 –

+0

본 기사를 읽었습니다. Google 검색에서 처음 나타납니다. 문제를 해결하려면 코드에서 정확히 무엇을 변경해야합니까? 왜냐하면 Metro는 내가 사용하고있는 TcpBinding을 지원하기 때문입니다. – expert

+0

HTTP MEX 바인딩을 사용해보세요. –

답변

6

나는 그것을 알아 냈습니다.

그것은 우리가 대신 내가 ReliableSession을 사용할 수 없습니다 즉

:-) 존재하지 않는 문서를 참조하는 지하철에서 작동 무엇인지 찾기 위해 비주얼 스튜디오의 소스를 컴파일해야 할 것은 불행한 일이다.

자세한 내용을 원하시면 C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.ServiceReference.Platforms.dll에는 지원되는 것을 확인하는 기능이 포함되어 있습니다.

private static bool IsBindingSupported(Binding binding) 
{ 
    if ((!(binding is BasicHttpBinding) && !(binding is CustomBinding)) && (!(binding is WSHttpBinding) && !(binding is NetTcpBinding))) 
    { 
     return false; 
    } 
    if (binding is WSHttpBinding) 
    { 
     if (((WSHttpBinding) binding).ReliableSession.Enabled) 
     { 
      return false; 
     } 
     if (((WSHttpBinding) binding).TransactionFlow) 
     { 
      return false; 
     } 
     if (((WSHttpBinding) binding).MessageEncoding != WSMessageEncoding.Text) 
     { 
      return false; 
     } 
    } 
    if (binding is NetTcpBinding) 
    { 
     if (((NetTcpBinding) binding).ReliableSession.Enabled) 
     { 
      return false; 
     } 
     if (((NetTcpBinding) binding).TransactionFlow) 
     { 
      return false; 
     } 
    } 
    foreach (BindingElement element in binding.CreateBindingElements()) 
    { 
     if (element is TransportBindingElement) 
     { 
      if ((!(element is HttpTransportBindingElement) && (!(element is HttpsTransportBindingElement) || (element as HttpsTransportBindingElement).RequireClientCertificate)) && !(element is TcpTransportBindingElement)) 
      { 
       return false; 
      } 
     } 
     else if (element is MessageEncodingBindingElement) 
     { 
      if (!(element is BinaryMessageEncodingBindingElement) || (((BinaryMessageEncodingBindingElement) element).MessageVersion != MessageVersion.Soap12WSAddressing10)) 
      { 
       if (element is TextMessageEncodingBindingElement) 
       { 
        if ((((TextMessageEncodingBindingElement) element).MessageVersion != MessageVersion.Soap11) && (((TextMessageEncodingBindingElement) element).MessageVersion != MessageVersion.Soap12WSAddressing10)) 
        { 
         return false; 
        } 
       } 
       else 
       { 
        return false; 
       } 
      } 
     } 
     else if (element is SecurityBindingElement) 
     { 
      if (!(element is TransportSecurityBindingElement)) 
      { 
       return false; 
      } 
      TransportSecurityBindingElement element2 = (TransportSecurityBindingElement) element; 
      if (!ValidateUserNamePasswordSecurityBindingElement(element2)) 
      { 
       if (((((element2.EndpointSupportingTokenParameters.Endorsing.Count == 1) && (element2.EndpointSupportingTokenParameters.Signed.Count == 0)) && ((element2.EndpointSupportingTokenParameters.SignedEncrypted.Count == 0) && (element2.EndpointSupportingTokenParameters.SignedEndorsing.Count == 0))) && ((element2.EndpointSupportingTokenParameters.Endorsing[0] is SecureConversationSecurityTokenParameters) && ((element2.MessageSecurityVersion == MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10) || (element2.MessageSecurityVersion == MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10)))) && ((element2.IncludeTimestamp && (element2.DefaultAlgorithmSuite == SecurityAlgorithmSuite.Default)) && (element2.SecurityHeaderLayout == SecurityHeaderLayout.Strict))) 
       { 
        SecureConversationSecurityTokenParameters parameters = (SecureConversationSecurityTokenParameters) element2.EndpointSupportingTokenParameters.Endorsing[0]; 
        if (parameters.RequireDerivedKeys || !(parameters.BootstrapSecurityBindingElement is TransportSecurityBindingElement)) 
        { 
         return false; 
        } 
        TransportSecurityBindingElement bootstrapSecurityBindingElement = (TransportSecurityBindingElement) parameters.BootstrapSecurityBindingElement; 
        if (!ValidateUserNamePasswordSecurityBindingElement(bootstrapSecurityBindingElement)) 
        { 
         return false; 
        } 
       } 
       else 
       { 
        return false; 
       } 
      } 
     } 
     else if ((!(element is SslStreamSecurityBindingElement) || (element as SslStreamSecurityBindingElement).RequireClientCertificate) && !(element is WindowsStreamSecurityBindingElement)) 
     { 
      if (!(element is TransactionFlowBindingElement)) 
      { 
       return false; 
      } 
      if ((!(binding is WSHttpBinding) || ((WSHttpBinding) binding).TransactionFlow) && (!(binding is NetTcpBinding) || ((NetTcpBinding) binding).TransactionFlow)) 
      { 
       return false; 
      } 
     } 
    } 
    return true; 
} 
관련 문제