Note that there are some explanatory texts on larger screens.

plurals
  1. POnet.tcp, The socket connection was aborted
    primarykey
    data
    text
    <p>i created the project which contains windows service (windowsservices.cs) and i added wcf contracts and service file in that class (windowservices.cs). its app.config file contains </p> <pre><code>&lt;service behaviorConfiguration="WindowsService1.Service1Behavior" name="AgentSvcImpl"&gt; &lt;endpoint address="" binding="netTcpBinding" bindingConfiguration="" name="nethttpendpoint" contract="IAgentWinService"&gt; &lt;identity&gt; &lt;dns value="localhost" /&gt; &lt;/identity&gt; &lt;/endpoint&gt; &lt;endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="nethttpmetadataendpoint" contract="IMetadataExchange" /&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="net.tcp://localhost:8011/AgentSvcImpl" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;/service&gt; </code></pre> <p>and in the windows service onstart method i entered following code:</p> <pre><code> ServiceHost serviceHost = null; if (serviceHost != null) { serviceHost.Close(); } //Create a URI to serve as the base address Uri httpUrl = new Uri("net.tcp://localhost:8011/AgentSvcImpl"); //Create ServiceHost serviceHost = new ServiceHost(typeof(WindowsService1.AgentSvcImpl), httpUrl); //Add a service endpoint serviceHost.AddServiceEndpoint(typeof(WindowsService1.IAgentWinService), new NetTcpBinding(), ""); //Enable metadata exchange ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); smb.HttpGetEnabled = false; serviceHost.Description.Behaviors.Add(smb); //Start the Service serviceHost.Open(); </code></pre> <p>when i am starting this service in services.msc, it started well. but when i try to add service reference it gives following error.</p> <p>Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:8011/AgentSvcImpl'. The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:04:59.0054016'. An existing connection was forcibly closed by the remote host If the service is defined in the current solution, try building the solution and adding the service reference again.</p> <p>how to resolve this? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload