17
Vote

Method 'ToXml' in type 'Chutzpah.VS2012.TestAdapter.ChutzpahAdapterSettings' does not have an implementation

description

Error: Method 'ToXml' in type 'Chutzpah.VS2012.TestAdapter.ChutzpahAdapterSettings' from assembly 'Chutzpah.VS2012.TestAdapter, Version=2.1.0.162, Culture=neutral, PublicKeyToken=1ca802c37ffe1896' does not have an implementation.

We are using TFS 2012 and VS 2012 with .NET 4.5. The problem is at VS2012.TestAdapter\ChutzpahAdapterSettings.cs in the ToXml method. It could be the override does not match that of the loaded assembly of Microsoft.VisualStudio.TestPlatform.ObjectModel.dll.

from LoRez:

"...It looks like I have a newer version of the Microsoft.VisualStudio.TestPlatform.ObjectModel.dll on my machine. My machine has version 11.0.51106.1 in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow. Whereas the adapter seems to be using version 11.0.50907.0. It looks like the signature for ToXml hasn't changed from what you've implemented..."

This problem does not seem to occur with tfs.visualstudio.com, but on a stand-alone build server. I believe the reason that this problem cannot be reproduced on tfs.visualstudio.com is that it only happens when Visual Studio 2012 is installed on the build server. That way it cannot load the version of Microsoft.VisualStudio.TestPlatform.ObjectModel.dll from your build assemblies folder because it is already loaded in memory on the build server.

file attachments

comments

greggbjensen wrote Mar 4, 2013 at 3:24 PM

This is a great addition to be able to run Chutzpah in the Build Server. Hopefully, we can find a way to get it to work. I will see if I can download the source and try building it with the Microsoft.VisualStudio.TestPlatform.ObjectModel.dll assembly from our build server.

greggbjensen wrote Mar 4, 2013 at 3:26 PM

I did try this again with 2.3, and encountered the same error.

greggbjensen wrote Mar 4, 2013 at 3:31 PM

I believe the reason that this problem cannot be reproduced on tfs.visualstudio.com is that it only happens when Visual Studio 2012 is installed on the build server. That way it cannot load the version of Microsoft.VisualStudio.TestPlatform.ObjectModel.dll from your build assemblies folder because it is already loaded in memory on the build server.

greggbjensen wrote Mar 4, 2013 at 3:33 PM

Here is the version 11.0.51106.1 of Microsoft.VisualStudio.TestPlatform.ObjectModel.dll that comes installed with Visual Studio 2012 for testing.

mmanela wrote Mar 4, 2013 at 3:42 PM

Do you have the Quarterly Update for VS 2012 installed?

greggbjensen wrote Mar 4, 2013 at 3:53 PM

I downloaded the latest source code and pointed it to the version 11.0.51106.1 and did not see a build error, so this must be a run-time error.

greggbjensen wrote Mar 4, 2013 at 7:43 PM

It looks like the build server is running on Visual Studio 2012, version 11.0.50727.1, so it does not have Update 1 installed yet. Should we install it to see if it resolves the issue?

dylanhayes wrote May 1, 2013 at 11:29 AM

Has anybody got any further with this problem?

I have the same problem, but don't have VS 2012 installed on the TFS server. I followed the original blog instructions, and tried variations suggested elsewhere in the some of the discussions here.

The problem occurred both before and after update 2 was applied to TFS.

I tried removing Microsoft.VisualStudio.TestPlatform.ObjectModel.dll from the chutzpah path, and I get the toXML method not implemented problem when I edited the process section of the build configuration, and if I add it back again, I get the same error:

Summary: There were 0 failures, 2 errors and 0 warnings loading custom activities and services.
Error: Method 'ToXml' in type 'Chutzpah.VS2012.TestAdapter.ChutzpahAdapterSettings' from assembly 'Chutzpah.VS2012.TestAdapter, Version=2.4.0.261, Culture=neutral, PublicKeyToken=1ca802c37ffe1896' does not have an implementation.
Error: Exception of type 'System.OutOfMemoryException' was thrown.

In both cases, if I look in the build log file it looks like tests have been found, but the tests don't get run:

Run Visual Studio Test Runner for Test Sources00:00:08
Inputs
ResultsDirectory:
TreatTestAdapterErrorsAsWarnings: False
UpdateFrequencyTimeout: 30
RunSettings:
Platform: x64
TestSources: System.Linq.OrderedEnumerable`2[System.String,System.String]
KeepAlive: False
UpdateFrequency: 5000
TestCaseFilter:
PublishResults: True
RunName: chutzpah
Flavor: Release
ExecutionTimeout: 0
ExecutionPlatform: X64
DisableAutoFakes: False
Test Run Completed. 0 tests executed.


I'm pretty sure the test have been found as if I change the pattern to a path with no tests, I see a message that there were no tests found 'There were no matches for the search pattern '

mika76 wrote Jun 2, 2013 at 6:50 AM

This does come up in VS2012 as well when running stand alone tests, if you have Stop on all exceptions turned on.

mmanela wrote Jun 4, 2013 at 4:14 AM

That is interesting and should help debug it.

Where do you set "Stop on all exceptions" in the test explorer?

japf wrote Jul 10, 2013 at 8:56 AM

Same problem here. I would be happy to help debugging if necessary as I cannot use it in TFS build right now.

mmanela wrote Jul 25, 2013 at 8:54 PM

I just setup a new server (win 8) and install vs 2012 Update 3 and TFS Update 3 and I do not get this issue. Is there a specific configuration this happens in?

kjrb wrote Oct 23, 2013 at 2:55 AM

I got Chutzpah running in 3 environments event though I could see the error that is a subject of that thread. The error shows when I edit the build definition The Process section) in VS. But, unit tests still run fine during the build.

The environments that are running tests (requirejs, quite complex test folder structure, knockout):

1) TFS Services

2) home dev machine (TFS 2012 Update3, and VS 2012 Update 3, Windows 8 and currently Windows 8,1 as well)

3) TFS server at work (2012 Update 3, VS 2012 Update 3 installed on TFS server).


The only issue that I had with tests not being run (totally ignored) was when VS 2012 was not installed on the TFS Server.

I have not tried to run Chutzpah in older versions of TFS or VS. Just 2012 Update 3.

I am posting this information because I got very discouraged by discussions about that error but it turned out to be a non issue for me.
So, it might not be really an issue if it's showing up only during edits of the build template vs. during the TFS build.

mmanela wrote May 17 at 4:34 PM

Does anyone have a repro machine they can lend me?

erchinoald wrote Jun 17 at 12:02 AM

I was trying to fix this nagging issue and although I wasn't successful, I think I stumbled on the underlying cause.

Microsoft.VisualStudio.TestPlatform.ObjectModel.dll is .NET 2.0 assembly and references System.Xml version 2.0. I rebuilt the Chutzpah source after changing the reference of System.Xml to the 2.0 version, in the project VS2012.TestAdapter. After making that change, now the error becomes:

Error: Method 'AddRunSettings' in type 'Chutzpah.VS2012.TestAdapter.ChutzpahAdapterSettingsService' from assembly 'Chutzpah.VS2012.TestAdapter, Version=3.2.2.0, Culture=neutral, PublicKeyToken=1ca802c37ffe1896' does not have an implementation.

If you look at the contract being implemented there, it is Microsoft.VisualStudio.TestWindow.Interfaces, which is a .NET 4.0 assembly and references System.Xml 4.0. This is where I got stuck.

Hope this helps.