Reputation: 11
I am seeing an issue whereby the following code behaves differently in different situations:
[TestMethod]
public void CodedUITestMethod1()
{
Process.Start("Outlook");
while (true)
{
Thread.Sleep(1000);
}
}
If the code is run on an agent by a TFS build definition, Outlook never connects to exchange (It says "DISCONNECTED" in the bottom system tray of Outlook. Any attempt to send emails result in them just sitting in the Outbox) If I take control of the VM through MS Environment Viewer and click "Stop" in the MS Test Agent, once the code stops running, Outlook connects to Exchange without any user interaction (eg I do not have to hit Send/Receive). If I run the code in the same VM, but triggered by a batch file in the startup folder (mstest /testcontainer:CodedUITestProject2.dll ), Outlook connects to Exchange just fine.
The MS Test Agent is running in "Interactive process" mode, not "Service" mode.
Can anyone shed any light as to why this may be happening?
Upvotes: 0
Views: 157
Reputation: 29976
It looks like the same with this issue on MSDN: Microsoft Test Agent appears to be blocking Outlook connectivity to Exchange
And the investigation result:
After installing fiddler I figured out what the problem was. The Microsoft Test Agent was activating a proxy server which was blocking connectivity to exchange. The proxy server was activated due to having the ASP.Net Client Proxy for IntelliTrace and Test Impact turned on.
Below is a link to the article with the exact same problem.
Upvotes: 1