I'm getting the following error when trying to run a coded ui test from MTM:
Unit Test Adapter threw exception: Method not found: 'Void Microsoft.VisualStudio.TestTools.UITest.Extension.UITestUtilities.AddAssemblyResolveHandler()'..
All I'm looking for is a hint as to why this is happening, my project references look like this:
I'm using Visual Studio 2013 Update 4, The Test Controller and Agent too are 2013 Update 4.
I can queue a build, but when I try and run a test against the build using MTM, I get this error.
EDIT, Also using net 4.5.1.
EDIT 2: Everything runs locally in dev environment when tests are kicked off from Visual Studio. It's once I kick off the tests through MTM -> Controller -> Agent where the problem persists. The exact same message is thrown regardless of the test.
Check if the test run has all the necessary dlls in the test run directory, in the machine where test controller runs check the directory
"C:\Users\ username \appdata\Local\VSEQT\QTController\ testrunid \Deployment\"
Related
I'm trying to run MSpec tests in Visual Studio's test system using Gallio, but it appears to be ignoring the MSpec plugin from the IDE. What I did:
Installed Gallio
Added the MSpec NuGet package to my test project
Added the Gallio NuGet package to my test project
Copied the three files required for the MSpec Gallio integration to an "MSpec" folder in Gallio's installation directory
Wrote an MSpec test
Ran "All Tests in Solution" in the IDE
This yielded the following error
"No tests were run because no tests are loaded or the selected tests are disabled"
To check Gallio itself, I added a reference to MbUnit and created a simple MbUnit test. I also ran Gallio's other tools to check if the plugin was being picked up at all. I even restarted VS for good measure.
Results
Running the tests using Gallio.Echo or Gallio.Icarus successfully executes both MbUnit and MSpec tests, so the plugin is being picked up. Running the tests from Visual Studio runs the MbUnit test but not the MSpec test, so Gallio integration appears to be working (just not the MSpec plugin). Any thoughts?
Before anyone mentions it: yes, I'd rather be using ReSharper but licenses are not an option for my situation at the moment.
Update: The is now a project to integrate MSpec into VS2012's test system. It's available on the Visual Studio Gallery and the source is on GitHub.
After starting to debug the problem with both project's sources, it appears there are two underlying issues causing the incompatibility between MSpec and Gallio's VS runner. However, both issues stem from the fact that the VS runner uses Cecil to load type information from assemblies (presumably to avoid loading the test assembly into the main VS AppDomain).
I'll update this answer as I uncover more (hopefully resulting in one or more patch to fix the issues).
Issue 1: Nested types are ignored
I had been using nested types for my tests (SubjectSpec+when_something), which are ignored by the Cecil-based reflection used by Gallio's VS runner to avoid loading the test assembly into the app domain.
This ended up being a relatively simple fix, which I've submitted as a patch to the Gallio developers. I'll update this answer if/when I get confirmation of which release it will be part of.
Issue 2: MSpec causes "An exception occurred while invoking a test driver"
If the container type is removed to avoid issue 1, MSpec throws this error. The reason for this is that MSpec is trying to create an instance of the test object, but Gallio is only supplying it a wrapper Type object that can't actually be created.
I am attempting to install Visual Studio 2010 Agents for Test Controller / Test Agents so I can create Load Tests on my local machine. When attempting to install the Test Controller I recieve the following message in the configuration summarry
From the installation log I found the following error messages:
The existing connection string for controller MyComputerName:6901 is {this is blank}
System.MissingMethodException: Method not found: 'Boolean
Microsoft.VisualStudio.TestTools.WebStress.LoadTestDatabaseCounterWriter.IsDatabaseUpgradeFromRTMNeeded(System.Data.SqlClient.SqlConnection)'.
at
Microsoft.VisualStudio.TestTools.ConfigCore.TestControllerHelper.CreateAndUpgradeLoadTestSchemaIfRequired(String
loadTestConnectionString, String directoryContainingSchemaFile) at
Microsoft.VisualStudio.TestTools.ConfigCore.ControllerConfiguration.UpdateLoadTestDatabase(ControllerConfigurationUpdatePack
updatePack, DelegateStatusUpdate statusListener)
Failed to configure load test database.
Problem solved!
Briefly, only Visual Studio 2010 Service Pack 1 is missing, and a DLL doesn't contain a method that is invoked by the Test Controller Configuration Tool.
Solution: install VS 2010 Service Pack 1.
Reason: Microsoft.VisualStudio.QualityTools.LoadTest.DLL does not contain a Database checker method that is invoked by the configuration tool, so an exception is thrown, and the configuration is failing. After upgrading to SP1, the DLL updates successfully and the missing method can be found there.
When I try to run my unit tests, either in the Visual Studio 2010 IDE or from the commands line (via mstest /testcontainer:my.dll), I get this error:
Failed to queue test run 'kootsookosp#TFSSERVER 2011-06-28 11:00:11': Method not found: 'Void Microsoft.VisualStudio.TestTools.Agent
.AgentProcessManager.SetCurrentPlatform(System.Reflection.ProcessorArchitecture, Microsoft.VisualStudio.TestTools.Common.AssemblyClr
Version)'.
Most other posts regarding mstest errors suggest an issue with security, but this seems different.
Googling the above error message doesn't appear to show anything much that seems relevant.
Is my.dll 64 bits? MSTest does not support that.
I am getting this error with my new unit test:
Unable to get type MyTestProject.MyTestClass, MyTestProject. Error: Could not load type 'MyTestProject.MyTestClass' from assembly 'MyTestProject'..
I have other tests in the project that were working just fine and now they are all showing a similar error message.
If I run the test in Resharper (rather than the built in Visual Studio Test runner) then it works fine. (I would just use that, but it is slower.)
Any idea what this could mean?
It's also happens when library under test is in GAC.
It's offen case when you develop for SharePoint.
Remove library from GAC if you don't need it there or deploy newest version to GAC.
It seems to me that the Visual Studio unit test runner is a little bit behind on the naming of your unittests. This sometimes happens when you rename a namespace or class.
This should clear the interenal cache: unload the project from your solution, run all tests, than reload the project.
Worked for me.
I fixed this for myself by cleaning the test project and then building it.
I'm developing a Visual Studio Integration Package. When I try to run the Unit Tests that are included in the unit test project that is included in the template I get the following failure on the first test:
The test adapter 'VsIdeHostAdapter'
threw an exception while running test
'MenuItemCallback'. Call was rejected
by callee. (Exception from HRESULT:
0x80010001 (RPC_E_CALL_REJECTED))
It's intermittent- a new instance of Visual Studio always spins up, then sometimes it works but usually fails.
Turns out this is a known issue- the built-in tests have some problems.