-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure DevOps Release Pipeline - Error Message: get_DataRow .. does not have an implementation #3238
Comments
As a side note - without changing anything else .. I have added the NUnit Test Framework and Test Adapter, and effectively copy-pasted my test code (with a few minor changes to update the syntax from MS Test to nUnit). The new nUnit tests are being identified and running in the DevOps Release pipeline without any issues. |
I'm getting the same error on my debug pipeline, but under different circumstances and was wondering whether they were the same as yours @MartinHatch80. Do you per chance have test projects for both Framework and Core in your pipeline? We have encountered the same error message. We've long had a running VSTest pipeline for our projects unit tests, which target Framework 4.8 and run MSTest. The YAML of the unit test on DevOps is very minimal:
We recently added a new MSTest project to our solution, which already gets built and procudes a different .dll as its artifact. It was just an empty MSTest project, targeting Core 6 instead:
With that project simply present, the above error message appears and not a single unit test is discovered. Despite that new MSTest project not being referenced by any other project, and despite VSTest correctly only discovering the same UnitTest.dll as before. For every test class xxxTests, the log contains a message of the form:
and at the end there is a message:
Notably, no project in the solution references the new MSTest project or it's single (empty, default) unit test, as should be. As soon as we remove the new MSTest project from the solution, all tests get discovered again. Weird! Now, I was able to disocver the potential root of the problem: I did notice that the Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll in the build output folder has a different size when the Core MSTest project is present - it's just 59kb, compared to109kb before. I then discovered that because of the Core 6 project, the NuGet reference to MSTest.TestAdapter - which both shows as version 2.2.8 - will actually resolve to different dlls than before. Namely, it uses the dll from mstest.testadapter\2.2.8\build\netstandard1.5 instead of mstest.testadapter\2.2.8\build_common, which targets Framework 4.5 The class TestContextImplementation in Framework 4.5 contains a public DataRow attribute, while the TestContextImplementation in Standard 1.5 does not. The moment the Core project is added to the solution, MSBuild will copy the Standard 1.5 dll into the output directory. But the Framework 4.5 UnitTest.dll was linked against the Framework 4.5 version, where the DataRow attribute IS present. When VSTest loads that library it discovers that the implementation for DataRow is missing and quits. I don't currently know how to solve this problem - there seems to be no way to force the 4.8 project to also use the Standard 1.5 version for the MSTest package, thereby linking against the same library that the other project uses, see also: But maybe - just maybe - you are seeing this behaviour on your pipeline because it's not actually well-defined which Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll gets copied to the output folder of your build, so maybe you have a similar situation and one pipeline always builts the Framework project before the Core one, and the other does it the other way around, and so a different Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll is present in the build folder in the end? It would be great if you could confirm or deny this. In any case, this doesn't seem to be a VSTest issue, but maybe rather an MSTest issue. I have opened an issue over there: |
Hi @Shanayara is this issue resolved? |
I'm still seeing this issue with VS2022 and MSBuild 17.5 when running tests from a unit test project that uses DataRow and targets both .NET 7 and .NET 4.8. I don't think it's resolved. [MSTest][Discovery][C:\dev\4\aaa\bin\Debug\net7.0\company.product.DataAdapter.Test.dll] MSTestAdapter failed to discover tests in class 'company.product.DataAdapter.Test.SourceCalendarTests' of assembly 'C:\dev\4\aaa\bin\Debug\net7.0\company.product.DataAdapter.Test.dll' because Method 'get_DataRow' in type 'Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.TestContextImplementation' from assembly 'Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' does not have an implementation.. |
Hey there, Have you started to get the issue after an update of MSTest or VSTest or did it suddenly started to fail? Would you mind sharing your project configuration (at least version of MSTest and SDK)? |
Sorry, I just noticed the ADO part on this issue (I was also looking at microsoft/testfx#1035, which is closed). This isn't only an issue with the VSTS ADO task, I also see it with
I have other dev and test projects that are multi-targeting 4.8 and 7.0 - those are working. Only the multi-targeted test project that uses DataRow is failing. |
@jbcutting Thanks for the details. Are you able to create a repro we could look at? So far we only had cases where the issue was occuring after an update and got cleared after some cleanup so we could not have a proper investigation. |
Apologies for the delayed response. While trying to create an isolated repro, I figured out the following. I'm sharing details in case they help anyone else who comes across this page in the future.
Thanks for trying to help me out, @Evangelink. |
Thanks for the details @jbcutting! Glag to hear the issue self cleared :) And at the same time, that's too bad for us to investigate 😢 I will try to have a look at |
I had this same issue with a Net 7 and Net48 test project in the same solution, worked locally fine, but could not run in DevOps. Resolved by forcing the net48 project test adapter reference.
|
I cannot reproduce and there is no clear way to reproduce this. Please let me know if you find a way to reproduce reliably so I can investigate. |
Description
I am getting an error message when trying to execute unit tests using a DevOps RELEASE pipeline.
The tests all execute without any issues at all when running from either:
I have checked and checked, and the settings between the Build and Release pipelines are IDENTICAL.
Steps to reproduce
Create .NET Framework 4.8 "Microsoft Unit Test" project using
Create a release pipeline in Azure DevOps running Unit Tests
Expected behavior
The unit tests run
Actual behavior
It fails to detect any unit tests with the above error message
Environment
Microsoft Unit Test project
.NET Framework 4.8
Azure DevOps RELEASE Pipeline
Pipeline agent running Windows-2019
This is the YAML of the Unit Test in DevOps
The text was updated successfully, but these errors were encountered: