Win32Exception @ ServiceHost.Open () for WCF service

I am working on writing BDD specifications for the wide range of WCF service infrastructure that I am writing. I noticed that every specification I write includes a call to ServiceHost.Open (), this line takes 2-6 seconds to execute (time keeps growing as I add more and more specifications). I noticed that when calling this method, a Win32Exception is thrown:

Win32Exception occurred
Message: The specified domain either does not exist or could not be contacted.
Stack Trace: at System.ServiceModel.UpnEndpointIdentity.GetUpnFromDownlevelName(String downlevelName)
NativeErrorCode: 1355
ErrorCode: -2147467259

ServiceModel configuration is as follows:

<system.serviceModel>
  <services>
    <service name="TestServices.Calculator" behaviorConfiguration="default">
      <endpoint
        name="calculator"
        address=""
        binding="wsHttpBinding"
        contract="TestServiceContracts.ICalculator" />
      <endpoint
        address="mex"
        binding="mexHttpBinding"
        contract="IMetadataExchange" />
      <host>
        <baseAddresses>
          <add baseAddress="http://localhost/calculator" />
        </baseAddresses>
      </host>
    </service>
  </services>

  <behaviors>
    <serviceBehaviors>
      <behavior name="default" >
        <serviceMetadata httpGetEnabled="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

Note. I configured Http.sys and added http: // +: 80 / calculator / as an exception to the HTTP namespace, so this is not part of the problem.

Windows 7 Ultimate. Vista Ultimate , , , ServiceHost.Open() - , . , , URL- localhost... , loopback .

+3
1

localhost vs dns... WCF, TranslateName() api UPN SAM- (, DOMAIN\user) , , SAM- , .

, , , - UPN - .

+4

Source: https://habr.com/ru/post/1719691/


All Articles