Wednesday 24 October 2012

Visual Studio 2010 Test Project - Typemock Isolator Add-In

I've spent 6 hours wondering why running a unit test within Visual Studio 2010 started failing. It appears to work OK when the setting host is configured to run in a 64 bit process on a 64 bit machine - but set it to force tests to run in a 32 bit process and the test fails.

The tests fail on VS2010. I have a simple unit test project with a single test that reads Assert.IsTrue(true);

Visual Studio says "Test Run Error" and "Test Host Process exited unexpectedly" and "Failed to queue test run <blah>: Unable to start the agent process"

The event viewer logs:

AgentProcess cannot register with AgentService, make sure service is running.
(QTAgent32.exe, PID 5828, Thread 1) AgentProcess: could not register with agent service: System.InvalidProgramException: Common Language Runtime detected an invalid program.
at System.Uri.ParseScheme(String uriString, Flags& flags, UriParser& syntax)
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at Microsoft.VisualStudio.TestTools.Execution.ExecutionUtilities.GetChannelUri(IChannelReceiver receiver)
at Microsoft.VisualStudio.TestTools.Execution.AgentContext.AddAgentProcessChannelUri(IChannelReceiver receiver)
at Microsoft.VisualStudio.TestTools.Agent.AgentProcess.Run()

I configured Agent32.exe.config to log:

<system.diagnostics>
    <switches>
      <!-- You must use integral values for "value".
           Use 0 for off, 1 for error, 2 for warn, 3 for info, and 4 for verbose. -->
      <!-- <add name="EqtTraceLevel" value="2" /> -->
   <add name="EqtTraceLevel" value="4" />
    </switches>
  </system.diagnostics>

<appSettings>
    <add key="CreateTraceListener" value="yes"/>
  </appSettings>

and then VSTTAgentProcess.log reports the following:

376, 1, 2012/10/24, 15:23:19.683, GMT00560\QTAgent32.exe, DefaultListener removed
I, 7376, 1, 2012/10/24, 15:23:19.691, GMT00560\QTAgent32.exe, Create trace listener in path: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE FileName: VSTTAgentProcess.log
I, 7376, 1, 2012/10/24, 15:23:19.693, GMT00560\QTAgent32.exe, AgentProcess: starting
V, 7376, 1, 2012/10/24, 15:23:19.885, GMT00560\QTAgent32.exe, ExecutionUtilities.RegisterIpcClientServerChannel: Registering IPC channel on IPC port 'eqt-a3a97055-63d2-6030-9889-4dabb07454ff'
V, 7376, 1, 2012/10/24, 15:23:19.977, GMT00560\QTAgent32.exe, ExecutionUtilities.RegisterIpcClientServerChannel: Successfully registered IPC channel on IPC port 'eqt-a3a97055-63d2-6030-9889-4dabb07454ff'
I, 7376, 1, 2012/10/24, 15:23:20.358, GMT00560\QTAgent32.exe, AgentProcess: Connecting to ipc://eqt-113ff837-7a8d-bbfa-ae5b-ec4faf4c7e57/AgentProcessManagerAccessManager.rem
V, 7376, 1, 2012/10/24, 15:23:20.380, GMT00560\QTAgent32.exe, AgentProcess: Calling GetAgentProcessProxy. Execution key: d1358a54-eee6-4108-90d8-0ae2c58092c5
E, 7376, 1, 2012/10/24, 15:23:20.744, GMT00560\QTAgent32.exe, AgentProcess: could not register with agent service: System.InvalidProgramException: Common Language Runtime detected an invalid program.
   at System.Uri.ParseScheme(String uriString, Flags& flags, UriParser& syntax)
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString)
   at Microsoft.VisualStudio.TestTools.Execution.ExecutionUtilities.GetChannelUri(IChannelReceiver receiver)
   at Microsoft.VisualStudio.TestTools.Execution.AgentContext.AddAgentProcessChannelUri(IChannelReceiver receiver)
   at Microsoft.VisualStudio.TestTools.Agent.AgentProcess.Run()
I, 7376, 1, 2012/10/24, 15:23:20.785, GMT00560\QTAgent32.exe, AgentProcess: shutting down.
I, 7376, 1, 2012/10/24, 15:23:20.789, GMT00560\QTAgent32.exe, AgentProcess: exiting

In the end I ran devenv.exe /safemode and by a process of elimination discovered that it was the Typemock Isolator add-in! I am running Typemock Isolator 6.1.2.

Our support agreement just expired. Is that conincidence? Does this add-in require a continual license to operate?

No comments:

Post a Comment