We are running a C# routine who retrieves emails from Exchange public folders. After migration from Exchange 2016 to 2019 we encounter a network problem:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. --->
The most curious part is, if the C# routine is called by our console test app (with or without debugging from VS) by a logged in user on that machine the access to Exchange via EWS works fine. If the routine is initiated by the continuously running WCF webservice on IIS10 the network error occurs.
Already tested: Upgrading Microsoft.Exchange.Webservices.dll to most recent version delivered with EXCHG2019. WCF webservice on IIS running under different user accounts (as local service, Domain Administrator, etc.).
Any idea? Thx.