Hi there,
To do the above using the config file I would do:
    <endpoint
      address="...."
      binding="netTcpBinding"
      bindingConfiguration="MyBinding"
      contract="IService1">
      <identity>
        <servicePrincipalName value="name"/>
      </identity>
    </endpoint>
But how do I add it to the below code?
            Uri uri = new Uri("......");
            ServiceHost host = new ServiceHost(typeof(Service1), uri);
            NetTcpBinding binding = new NetTcpBinding();
            binding.Security.Mode = SecurityMode.Message;
            binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
            host.AddServiceEndpoint(typeof(IService1), binding, uri);
            host.Open();