search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Exception User-Unhandled

Related article: Loading Calendar Appointments from Exchange Server (Office 365) using EWS (ASP.NET)
Asked by Eryk
5 years ago.

Hello,
in the 42 line of Default.espx.cs I got error:
"SocketException: No connection could be made because the target machine actively refused it"
Do you maybe know the reason? It's really important to solve this issue.
Regards,
Eryk

Comment posted by Dan Letecky [DayPilot]
5 years ago.

You should check the URL of the service. In the original file it's on line 22:

service.Url = new Uri("https://outlook.office365.com/ews/exchange.asmx");

The error suggests that the application is not able to connect to port 443 on the specified server. When using a custom URL, you should check that an Exchange server is running there and that no firewall is blocking access.

Comment posted by Eryk
5 years ago.

I use exactly the same url in my code.

Comment posted by Eryk
5 years ago.

I mean, I didn't change anything in your code and it still generates that exception... Do you have any ideas where I can check for mistakes?

Comment posted by Dan Letecky [DayPilot]
5 years ago.

This is not a problem in the code, it's a network issue. Your computer isn't able to open a TCP/IP connection to the target machine. You'll need to contact your network administrator to resolve the problem. The connection may be blocked by a firewall (intentionally or unintentionally).

Comment posted by Eryk
5 years ago.

I created a Console application in C# and used the same URL in configuration of ExchangeService and it works... The problem occurs only with ASP.NET projects.

Answer posted by Eryk
5 years ago.

Yes, thank you so much. I've checked in WireShark the IP address my app was trying to connect with. Then I set that address (with another port) as a proxy and suddenly it started to work. Thank you!

Comment posted by Dan Letecky [DayPilot]
5 years ago.

Great, thanks for the update!

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.