title: Issue with Listening at an Endpoint connecting to WCF from net.tcp protocol
body: <p>This weird Error was appearing from one day before posting this post. Previously it was working fine, but not now.</p>
  
  <p>At one movement restarting the system, the error disappears and able to access the application.</p>
  
  <p>and after again rebooting the system the error begins to appear without knowing the root cause.</p>
  
  <p>Enabled Protocols: <code>net.tcp,http</code></p>
  
  <p>I could able to browse the below link</p>
  
  <ul>
  <li><a href="http://localhost/TAServices/AuthenticationManager.svc" rel="nofollow noreferrer">http://localhost/TAServices/AuthenticationManager.svc</a></li>
  <li><a href="http://username.domainname.com/TAServices/AuthenticationManager.svc?wsdl" rel="nofollow noreferrer">http://username.domainname.com/TAServices/AuthenticationManager.svc?wsdl</a></li>
  <li><a href="http://username.domainname.com/TAServices/AuthenticationManager.svc?singleWsdl" rel="nofollow noreferrer">http://username.domainname.com/TAServices/AuthenticationManager.svc?singleWsdl</a></li>
  </ul>
  
  <p>Here is the below snippet which causes an exception</p>
  
  <pre><code>objCheckUserLoginResponse = AuthenticationManagerClient.Check(objCheckUserLoginRequest, objCustomer);
  </code></pre>
  
  <p><strong>Exception:</strong></p>
  
  <pre><code>The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/TAServices/AuthenticationManager.svc' is unavailable for the protocol of the address. 
  System.ServiceModel.EndpointNotFoundException: The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/TAServices/AuthenticationManager.svc' is unavailable for the protocol of the address.
  
  Server stack trace: 
     at System.ServiceModel.Channels.ConnectionUpgradeHelper.DecodeFramingFault(ClientFramingDecoder decoder, IConnection connection, Uri via, String contentType, TimeoutHelper&amp; timeoutHelper)
     at System.ServiceModel.Channels.StreamedFramingRequestChannel.SendPreamble(IConnection connection, TimeoutHelper&amp; timeoutHelper, ClientFramingDecoder decoder, SecurityMessageProperty&amp; remoteSecurity)
     at System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper&amp; timeoutHelper)
     at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
     at System.ServiceModel.Channels.StreamedFramingRequestChannel.StreamedFramingRequest.SendRequest(Message message, TimeSpan timeout)
     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
     at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
  
  Exception rethrown at [0]: 
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
     at TA.ServiceProxy.AuthenticationManager.IAuthenticationManager.Check(CheckUserLoginRequest1 request)
     at TA.ServiceProxy.AuthenticationManager.AuthenticationManagerClient.TA.ServiceProxy.AuthenticationManager.IAuthenticationManager.Check(CheckUserLoginRequest1 request) in D:\2017_TFS\TestandAssessment\Dev\Manifest\TestPrepAdmin\ServiceProxy\Service References\AuthenticationManager\Reference.cs:line 3370
     at TA.ServiceProxy.AuthenticationManager.AuthenticationManagerClient.Check(CheckUserLoginRequest Request, Customer Customer) in D:\2017_TFS\TestandAssessment\Dev\Manifest\TestPrepAdmin\ServiceProxy\Service References\AuthenticationManager\Reference.cs:line 3377
     at TA.UIFrameWork.AuthenticationManagement.AuthenticateUser(CheckUserLoginRequest objCheckUserLoginRequest) in D:\2017_TFS\TestandAssessment\Dev\Manifest\TestPrepAdmin\UIFrameWork\Authentication\AuthenticationManagement.cs:line 19
   T: 2020-05-09 12:19:52,242 |L: INFO |TH: 8 |L: Utilities.PageBase |MSG: 
  SessionID:  Method: LoadLanguages
  Info: Page: Login.aspx Method: LoadLanguages Enters
  </code></pre>
  
  <p>AuthenticationManagement.cs</p>
  
  <pre><code>using TA.ServiceProxy.AuthenticationManager;
  using System;
  
  namespace TA.UIFrameWork
  {
      public class AuthenticationManagement
      {
          public CheckUserLoginResponse AuthenticateUser(CheckUserLoginRequest objCheckUserLoginRequest)
          {
              Customer objCustomer;
              CheckUserLoginResponse objCheckUserLoginResponse = null;
              try
              {
                  objCustomer = new Customer();
                  objCustomer.CustomerName = "ABC";
                  objCustomer.CultureInfo = "English";
                  AuthenticationManagerClient AuthenticationManagerClient = new AuthenticationManagerClient();
                  AuthenticationManagerClient.Open();
                  objCheckUserLoginResponse = AuthenticationManagerClient.Check(objCheckUserLoginRequest, objCustomer);
                  AuthenticationManagerClient.Close();
                  AuthenticationManagerClient = null;
                  objCustomer = null;
                  objCheckUserLoginRequest = null;
              }
              catch (Exception ex)
              {
                  LoggingFramework.log.Error(ex.Message, ex);
              }
              return objCheckUserLoginResponse;
          }
        }
      }
  }
  </code></pre>
  
  <p>web.config</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" /&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&gt;
      &lt;section name="dns" type="System.Configuration.NameValueFileSectionHandler" /&gt;
    &lt;/configSections&gt;
    &lt;dataConfiguration defaultDatabase="LocalSqlServer" /&gt;
    &lt;dns file="dns.config" /&gt;
    &lt;system.web&gt;
      &lt;!-- Web Part --&gt;
      &lt;membership&gt;
        &lt;providers&gt;
          &lt;clear /&gt;
          &lt;add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" applicationName="/MVCFramework" /&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
      &lt;profile enabled="true" defaultProvider="TableProfileProvider"&gt;
        &lt;providers&gt;
          &lt;clear /&gt;
          &lt;add name="TableProfileProvider" type="Microsoft.Samples.SqlTableProfileProvider" connectionStringName="LocalSqlServer" table="aspnet_Profile" applicationName="/MVCFramework" /&gt;
        &lt;/providers&gt;
      &lt;/profile&gt;
      &lt;!-- End Web Part --&gt;
  
      &lt;pages validateRequest="false" enableEventValidation="false" enableViewStateMac="false" maintainScrollPositionOnPostBack="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"&gt;
        &lt;controls&gt;
          &lt;add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" /&gt;
        &lt;/controls&gt;
      &lt;/pages&gt;
      &lt;customErrors mode="Off"&gt;
        &lt;error statusCode="403" redirect="Status.aspx" /&gt;
        &lt;error statusCode="404" redirect="Status.aspx" /&gt;
      &lt;/customErrors&gt;
      &lt;httpCookies httpOnlyCookies="true"&gt;
      &lt;/httpCookies&gt;
      &lt;trace enabled="false" localOnly="true"&gt;
      &lt;/trace&gt;
      &lt;httpRuntime maxRequestLength="2097151" executionTimeout="220000" requestValidationMode="2.0" /&gt;
      &lt;!-- 
              Set compilation debug="false" to insert debugging 
              symbols into the compiled page. Because this 
              affects performance, set this value to true only  
              during development.
          --&gt;
      &lt;compilation debug="true" defaultLanguage="c#" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
        &lt;/assemblies&gt;
        &lt;buildProviders&gt;
          &lt;add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /&gt;
        &lt;/buildProviders&gt;
      &lt;/compilation&gt;
      &lt;sessionState mode="InProc" timeout="6000" cookieless="UseCookies"&gt;
      &lt;/sessionState&gt;
      &lt;authorization&gt;
        &lt;allow users="?" /&gt;
      &lt;/authorization&gt;
  
      &lt;httpHandlers&gt;
        &lt;add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" /&gt;
        &lt;add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" /&gt;
      &lt;/httpHandlers&gt;
    &lt;/system.web&gt;
    &lt;system.net&gt;
      &lt;settings&gt;
        &lt;servicePointManager expect100Continue="false" /&gt;
      &lt;/settings&gt;
    &lt;/system.net&gt;
    &lt;system.webServer&gt;
      &lt;security&gt;
        &lt;requestFiltering&gt;
          &lt;requestLimits maxAllowedContentLength="1024000000"&gt;&lt;/requestLimits&gt;
        &lt;/requestFiltering&gt;
      &lt;/security&gt;
      &lt;validation validateIntegratedModeConfiguration="false" /&gt;
      &lt;handlers&gt;
        &lt;remove name="ChartImageHandler" /&gt;
        &lt;add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt;
      &lt;/handlers&gt;
      &lt;modules&gt;
        &lt;add name="QueryStringValidation" type="Presentation.Utilities.QueryStringValidation" /&gt;
      &lt;/modules&gt;
    &lt;/system.webServer&gt;
  
    &lt;system.data&gt;
      &lt;DbProviderFactories&gt;
        &lt;remove invariant="MySql.Data.MySqlClient" /&gt;
        &lt;add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.3.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /&gt;
      &lt;/DbProviderFactories&gt;
    &lt;/system.data&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="BasicHttpBinding_Framework" closeTimeout="00:50:00" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:50:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="999999999" maxBufferPoolSize="524288" maxReceivedMessageSize="999999999" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="999999999" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;security mode="None"/&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
        &lt;netTcpBinding&gt;
          &lt;binding name="NetTcpBinding_Framework" closeTimeout="00:50:00" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:51:00" transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="999999999" maxBufferSize="999999999" maxConnections="10" maxReceivedMessageSize="999999999"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="999999999" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;reliableSession ordered="true" inactivityTimeout="00:50:00" enabled="false" /&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" /&gt;
              &lt;message clientCredentialType="Windows" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/netTcpBinding&gt;
      &lt;/bindings&gt;
     &lt;client&gt;
        &lt;endpoint address="net.tcp://localhost/TAServices/AccountManager.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_Framework" contract="AccountManager.IAccountManager" name="NetTcpBinding_Framework" /&gt;
    &lt;/client&gt;
      &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name="ClientBehavior"&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="10000000" /&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
    &lt;location path="Common"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;allow users="?" /&gt;
        &lt;/authorization&gt;
      &lt;/system.web&gt;
    &lt;/location&gt;
    &lt;system.web.extensions&gt;
      &lt;scripting&gt;
        &lt;webServices&gt;
          &lt;jsonSerialization maxJsonLength="5000000" /&gt;
        &lt;/webServices&gt;
      &lt;/scripting&gt;
    &lt;/system.web.extensions&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Without knowing the cause I was not able to do anything.
  Please suggest in resolving <code>EndpointNotFoundException</code> issue wrt to code or from windows 10 (1903)</p>