Skip to content

MissingMethodException: Method not found #673

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

Closed
lukos opened this issue Jan 3, 2020 · 8 comments
Closed

MissingMethodException: Method not found #673

lukos opened this issue Jan 3, 2020 · 8 comments
Labels
as-designed Expected behaviour

Comments

@lukos
Copy link

lukos commented Jan 3, 2020

This is the same error as #456 but I am unsure about the cause in my case.

I am using a dockerfile based on bionic 2.2, which should be DotNetCore 2.2.8 according to docker but when I run dotnet test, I get the error:

Data collector 'XPlat code coverage' message: [coverlet]System.MissingMethodException: Method not found: '!!0 Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection.SessionStartEventArgs.GetPropertyValue(System.String)'.
   at Coverlet.Collector.DataCollection.CoverletCoverageCollector.GetTestModules(SessionStartEventArgs sessionStartEventArgs)
   at Coverlet.Collector.DataCollection.CoverletCoverageCollector.OnSessionStart(Object sender, SessionStartEventArgs sessionStartEventArgs) in C:\Users\toni\Workspace\coverlet\src\coverlet.collector\DataCollection\CoverletCoverageCollector.cs:line 102.

I have installed the nuget package for coverlet at v1.1.0 and the test execution command line tool is 16.0.1

@MarcoRossignoli MarcoRossignoli added the as-designed Expected behaviour label Jan 3, 2020
@MarcoRossignoli
Copy link
Collaborator

You should upgrade Microsoft.NET.Test.Sdk reference in your test project https://github.com/tonerdo/coverlet#requirements

@MarcoRossignoli
Copy link
Collaborator

Also there is at the moment a know issue on vstest plat that fails to load coverlet collectors https://github.com/tonerdo/coverlet/blob/master/Documentation/KnowIssues.md#2-upgrade-coverletcollector-to-version--100

@lukos
Copy link
Author

lukos commented Jan 3, 2020

@MarcoRossignoli Microsoft.NET.Test.Sdk was already at 16.4, which was above requirements. I also tried upgrading to 16.5.0-preview but have the same problem.

It doesn't appear to be the known issue since coverlet is loading and attempting to read something. I will try using a run file to see if that changes anything.

Thanks

@MarcoRossignoli
Copy link
Collaborator

@lukos can you confirm that all it's ok out of docker?I mean if you run on your local does it work?

@lukos
Copy link
Author

lukos commented Jan 3, 2020

Yes, when I run it locally, it runs fine and outputs the cobertura file. An obvious difference I can see is that my local dotnet exe is 16.3.0 as opposed to 16.0.1 in the docker image so I will see if I can update that as part of the docker build.

@MarcoRossignoli
Copy link
Collaborator

That could be the issue cc: @vagisha-nidhi for confirmation

@lukos
Copy link
Author

lukos commented Jan 3, 2020

I just found another github issue about the 2.2 image not containing the correct CLI tools version and a massive complicated discussion about the complexity of docker images with multiple SDK/runtime combinations. I think for now, the only way forward for me is to upgrade the project to 3.1, which will probably work OK but has other implications since all of our projects are currently 2.2 and I don't know how easily it will all "just work" in deployment if I upgrade them. I'll close this for now.

@lukos lukos closed this as completed Jan 3, 2020
@MarcoRossignoli
Copy link
Collaborator

Ok feel free to re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
as-designed Expected behaviour
Projects
None yet
Development

No branches or pull requests

2 participants