.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

No connection could be made because the target machine actively refused it ipadd:port at system.Net.

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :Windows Application
 
Hi, I am writing code to send  an email whenever my application has an unhandled error. With this same code i could get it runnign on a gmail smtp server. However, when i replaced these values wit hvalues for my smtp host, i am gettin the following error. Why am i getting this error? Private Sub EmailTest(ByVal errorMsg As String) Dim SmtpServer As New SmtpClient() SmtpServer.Credentials = New Net.NetworkCredential("me@tremail.com", "test123") SmtpServer.Port = 22 SmtpServer.Host = "smtp.myhost.com" SmtpServer.EnableSsl = True Dim mail As New MailMessage() Try mail.From = New MailAddress("me@tremail.com", "Web Developers", System.Text.Encoding.UTF8) mail.To.Add("target@tremail.com") mail.Subject = "Error Messages in Application" mail.Body = errorMsg SmtpServer.Send(mail) Catch ex As Exception MsgBox(ex.ToString()) End Try End Sub I am getting the following error. System.Net.Mail.smtpException:Failure sending Mail.----->System.Net.WebException:Unable to connect to remote server---->System.Net.Sockets.socketException:No connection could be made because the target machine actively refused it ipadd:port at system.Net.sockets.Socket.doConnect


View Complete Post


More Related Resource Links

TCP error code 10061: No connection could be made because the target machine actively refused it.

  
I hosted a wcf service application using windows services. When my client (ASP.NET) tries to call the service class hosted by the windows service, I get this error "TCP error code 10061: No connection could be made because the target machine actively refused it. ". Is there a fix for this? The same code works fine if I host it using a console application.

No connection could be made because the target machine actively refused it 127.0.0.1:8888

  

Hi This is Satish Nandigam,

I develop a Restful web service in vs 2008

I hosted in the IIS 5.1 . Its working perfectly while i ping the url in the browser

like http://localhost/servicename/serversice.svc

http://satishn/servicename/serversice.svc

http://192.168.1.123/servicename/serversice.svc.

 

But problem is  consume the service in the client code.

I am able consume the service http://localhost/servicename/serversice.svc

but change the url like

http://satishn/servicename/serversice.svc

http://192.168.1.123/servicename/serversice.svc. its give error like Unable connect to the server. And i see the inner exception is No connection could be made because the target machine actively refused it 127.0.0.1:8888.

 

Here is the Exception details

 

System.Net.WebException was unhandled by user code
  Message="Unable to connect to the remote server"
  Source="System"
  StackTrace:
       at System.Net.HttpWebRequest.GetResponse()
       at SatoreServiceClient.Default.Button6_Click(Object sender, EventArgs e) in D:\Projects\Satori WebService\Client\Default.aspx.cs:line 398
       at System.Web.UI.WebControls.Bu

No connection could be made because the target machine actively refused it 127.0.0.1:8888

  

Hi This is Satish Nandigam,

I develop a Restful web service in vs 2008

I hosted in the IIS 5.1 . Its working perfectly while i ping the url in the browser

like http://localhost/servicename/serversice.svc

http://satishn/servicename/serversice.svc

http://192.168.1.123/servicename/serversice.svc.

 

But problem is  consume the service in the client code.

I am able consume the service http://localhost/servicename/serversice.svc

but change the url like

http://satishn/servicename/serversice.svc

http://192.168.1.123/servicename/serversice.svc. its give error like Unable connect to the server. And i see the inner exception is No connection could be made because the target machine actively refused it 127.0.0.1:8888.

 

Here is the Exception details

 

System.Net.WebException was unhandled by user code
  Message="Unable to connect to the remote server"
  Source="System"
  StackTrace:
       at System.Net.HttpWebRequest.GetResponse()
       at SatoreServiceClient.Default.Button6_Click(Object sender, EventArgs e) in D:\Projects\Satori WebService\Client\Default.aspx.cs:line 398
       at System.Web.UI.WebControls.Bu

No connection could be made because the target machine actively refused it

  

I am on the console of a server with a SQL Server 2008 installation.

I CAN successfully connect to the instance with this command:     c:\>    sqlcmd -E -S localhost\DW

I can NOT successfully connect with this one:    c:\>   sqlcmd -E -S localhost\DW,1433

---

  • Remote Server connections are enabled under server properties, connections
  • Under SQL Server configuration manager, "Protocols for DW" has TCP/IP enabled, TCP Dynamic Ports empty, TCP Port set to 1433.
  • My firewall is shutdown
  • I've restarted the SQL Server instance after config manager changes.

 

I receive this message:

HResult 0x274D, Level 16, State 1
TCP Provider: No connection could be made because the target machine actively refused it.

Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..Sqlcmd: Error: Microsoft SQL Server N

No connection could be made because the target machine actively refused it

  

I am using SharePoint 2010 Word Automation Services to convert documents (docx to xps).

When I try to start the ConversionJob, I get the following exception:

EndpointNotFoundException

Could not connect to http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:32843.

The method generate this Exception is the Start() one. The code is the following one:

//...<br/>
ConversionJob job = new ConversionJob(wordAutomationServiceName);<br/>
job.UserToken = spSite.UserToken;<br/>
job.Settings.UpdateFields = true;<br/>
job.Settings.OutputFormat = SaveFormat.XPS;<br/>
job.AddLibrary(inputListName, outputListName);<br/>
         <br/>
job.Start();<br/>
//...

I tried the firewall configuration, but i was not.

The stack trace is the following:

Server stack trace:
   at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
   at System.ServiceModel.Ch

SQL Server Configuration Manager: Connection to target machine could not be made in a timely fashion

  
I have a SQL Server 2005 box that was moved from a domain environment to a non-domain environment and was never dropped from its original domain before moving over.  Subsequently a new domain was created at the data center this SQL Server box now resides in.  The machine was dropped from its old domain and joined to the new one.   All the while the service accounts were set to the local admin account.  When I tried to start the Configuration Manager I got the message "Connection to target machine could not be made in a timely fashion.".  I read some blog entries and tried changing all the service accounts to Local System and the error message still came up.   All of the SQL Server services run fine.  It is just this management console that I cannot open.  I wasn't with this employer when this box was moved to the data center so I do not know if it worked prior and there isn't anyone here that could give me its history.   Any help would be appreciated.

Fixed : Report builder 3.0 : "Connection failed", "actively refused"

  

Edit : ok, I screw up.

My Sql server wasn't a R2. 

I don't understand how I downloaded the wrong version and successfully install R2 sp1...

I really don't get it. But that fixed now.

---

Hi, i'm running 

 

  • windows 7 x64 Pro
  • Sql server 2008 R2 + Sp1
  • Microsoft SQL Server Reporting Services Version 10.0.2531.0

i'm able to connect to my reportservice with BIDS and Report Builder 2.0.
But with Report Builder 3.0 (10.50.1600.1, running as Admin) the connection failed.
I sniffed the packet with fiddler and found an 
[Fiddler] 504 Connection Failed: No connection could be made because the target machine actively refused it 192.168.1.170:443<BR>Timestamp: 11:49:18.676

---

Edit : add connection Fiddler resume.

 

#	Result	Protocol	Host	URL	Body	Caching	Content-Type	Process	Comments	Custom	
1	401	HTTP	guillaume-pc	/ReportServer/ReportService2010.asmx	0			msreportbuilder:5292			
2	401	HTTP	guillaume-pc	/ReportServer/ReportService2010.asmx	0			msreportbuilder:5292			
3	200	HTTP	guill

Socket Connection Is Actively Refused

  
I have a server application written is C/C++ that finds an available port, creates a socket, and starts listening.  The server posts its IP Address and port to a database so that clients can connect to the server.  I have a Client application written in C/C++ that has no problem connecting to this server; however, I am rewriting that client application in C# and I cannot get the client to connect to the server.  I consistently receive a "No connection could be made because the target machine actively refused it 10.0.0.6:26069" exception.  I have stepped through the code and the IP Address and port look correct to me.  I don't think this is a firewall problem since my other client is able to connect and I have tried my new client with the firewall disabled.  The server is using verson 2.0 sockets.  Below is the code I am using in my C# client to try to connect to my server.
// Create an IP Address from the data read from the DB

localhost is not set up to establish a connection on port 51624 with this computer

  

I'm trying to run asp.net locally, but getting the error

localhost is not set up to establish a connection on port 51624 with this computer

How can I fix it?


A connection could not be made to the report server http://localhost/ReportServer.

  

Hi,

  • I created a Report using Business Intelligence Studio. Its working working well, i can able to view records. But when i try to deploy the report an error occurs specifying that "A connection could not be made to the report server http://localhost/ReportServer. (Microsoft Report Designer)".
  • I open the IIS 7 and find out virtual directories "Reports" and "ReportServer" are available.
  • I check on the browser and type "http://localhost/reports".  I find the browser direct to this url: http://localhost/reports/Pages/Folder.aspx and find error specifying the following one:

         Error:The report server is not responding. Verify that the report server is running and can be accessed from this computer.

  • when i type http://localhost/reportmanager, i found the error:

    HTTP Error 404.0 - Not Found

    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    <

CheckedListBox displays System.Data.DataRowView on one machine

  
As I was writing this post I solved my problem. Now I will share the solution for anyone who may stumble across this legacy cr*p. I inherited an old VB.NET application written in the old Visual Studio .Net against the 1.0 framework. Recently we had to rebuild a couple of machines and redeploy the app. We have CheckedListBox controls bound using the DataSource property and suddenly all we could see was System.Data.DataRowView in the list on these machines. All the forums out there tell you that binding the items with the DataSource property is not supported by Microsoft and offer code fixes, which we obviously do not want to do. I installed the .Net Framework 1.0 redistributable and fixed it right up. Which is a little strange because one of the machines it still works on only has 1.1. But there you have it  I actually tested this on another machine by installing 1.1 first, which did not fix the problem, but installing 1.0 did. And another interesting thought. The executable and its class library dependency reside in a network share. After installing the 1.0 framework I had to run a Caspol.exe command to grant privs to the share or the executable could not access the library. The app functioned fine without the Caspol.exe command (except the ListBox of course) prior to installing the 1.0 framework. Strange stuff...Hope this helps someone someday.

System.IO.IOException: Unable to read data from the transport connection

  
Hello,   I have an xml webservice calling another xml web service and occasionally i get the following error - any ideas why?Does this happen when the request is made or when reading the response? Also how i can prevent it from happening? Thanks   System.IO.IOException: Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall. ---> System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)   --- End of inner exception stack trace ---   at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)   at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean readToUserBuffer)   at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)   at System.Xml.XmlTextReaderImpl.ReadData()   at System.Xml.XmlTextReaderImpl.InitTextReaderInput(String baseUriStr, TextReader input)   at System.Xml.XmlTextReaderImpl..ctor(String url, TextReader input, XmlNameTable nt)   at System.Xml.XmlTextReader..ctor(TextReader input)   at System.Web.Services.Protocols.SoapHttpClientProtocol.GetReaderForMessage(SoapClientMessage message, I

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a rec

  
Hello Guys,         I am getting following exception while web service (ASMX) is returning the response. <!-- [if gte mso 10]> <mce:style> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.     <!-- [if gte mso 10]> <mce:style>                                                     InnterException (System.IO.Exception): "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."       I think either the Asp.net web server is closing the connection or the response is too long.   Following is my simple code.    1)   namespace JFA.IndiePay.BusinessAccess { public class VerTexProcessor { public DataSet ProcessVerTexForBatch(DataSet dsInputRequest) { DataSet dsResponse = new DataSet(); //Call vertex web service here. VertexService.Service texCalculator = new VertexService.Service(); texCalculator.Timeout = 500000;

Adomd.net "A Connection Cannot be Made , Ensure that the server is running"

  
Hi I am connecting to my local cube from vb.net windows forms application. This form is called several times within my application. While in the application, i close the form and reopen it frequently.  The conAdomd.Open() functions without any error for the first three times . As in , when i launch the windows forms application for the third time, i get an error "A connection cannot be made, Please ensure that the server is running". I have tried installing the patches, but it does'nt help me.  Request help from forum members. Dim conAdomd As New AdomdConnection() conAdomd.ConnectionString = String.Format("Provider=MSOLAP.3;Data Source={0};", filename)     conAdomd.Open()

An established connection was aborted by the software in your host machine

  
Hello, i am facing problem with socket connection aborted for one of the service. Following is the detailed error,   ORIGINAL EXCEPTION:   An exception of type 'System.ServiceModel.CommunicationObjectAbortedException' occurred and was caught. ------------------------------------------------------------------------------------------------------- 06/25/2010 10:06:20 Type : System.ServiceModel.CommunicationObjectAbortedException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : The socket connection was aborted by your local machine. This could be caused by a channel Abort(), or a transmission error from another thread using this socket. Stack Trace :  Server stack trace:     at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)    at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)    at System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)    at System.ServiceModel.Channels.SessionConnectionReader.Receive(TimeSpan timeout)    at System.ServiceModel.Channels.SynchronizedMessageSource.Receive(TimeSpan timeout)    at System.ServiceModel.Channels.FramingDup

A connection could not be made to the report server - Problem deploying an SSRS report from Business

  
I’m having trouble with what seems to be a common issue for people, regarding deployment of an SSRS report from Business Intelligence Development Studio. Unfortunately none of the solution I have seen posted here (and elsewhere) have been able to help me so far.   Two of my collegaues can both deploy with no problem, and I am using exactly the same Target destinations as them (TargetDataSourceFolder, TargetReportFolder, TargetServerURL).   I have posted the error message below, which from my basic understaning would indicate, I think, a security issue (perhaps something local to my PC, or user account)   Has anyone experienced this particular issue who might be able to help?   Best wishes, Jamie TITLE: Microsoft Report Designer ------------------------------ A connection could not be made to the report server http://turpin-net.turpin-bg.local/Reportserver. ------------------------------ ADDITIONAL INFORMATION: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message: -- <HTML dir="ltr"> <HEAD><meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid" content="SharePoint.WebPartPage.Document" /><meta HTTP-EQUIV="Content-Type" content="text/html; c

a connection could not be made to the reporting server

  
I have made a report using SQL Server Business Intelligence Development Studio. When I try to deploy I get the following error "a connection could not be made to the reporting server". I went to IE and was able to make a connection but not when deploying. I also right clicked on the project and selected properties and verified if the Target URL was correct and it is. Can anyone help. Thanks
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend