Skip to content
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

System.Reflection.Metadata version mismatch unable to find file System.Reflection.Metadata,Version=1.4.3.0 #391

Closed
vagisha-nidhi opened this issue May 2, 2019 · 6 comments
Labels
blocking-users Issue is blocking some users

Comments

@vagisha-nidhi
Copy link
Contributor

I am trying to load coverlet into a datacollector which would collect coverage and report back the results to TestPlatform. The issue with loading coverlet APIs is that coverlet.core depends on System.Reflection.Metadata, AssemblyVersion : 1.4.3.0 and the datacollector process (in which it is being loaded) has a dependency on System.Reflection.Metadata, AssemblyVersion=1.4.2.0

This results in System.Reflection.Metadata, AssemblyVersion=1.4.2.0 being loaded and coverlet erroring out with System.IO.FileLoadException: Could not load file or assembly 'System.Reflection.Metadata, Version=1.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file.

This can be resolved with lowering down the version of System.Reflection.Metadata.

I am a Software Engineer on the TestPlatform team and can raise a PR to address the issue.

@MarcoRossignoli
Copy link
Collaborator

I am trying to load coverlet into a datacollector which would collect coverage and report back the results to TestPlatform.

Can you elaborate the scenario?We have some work in place to use coverlet with data collector to fix issue where test plat kill process before we can save instrumentation report file to disk #329

@MarcoRossignoli MarcoRossignoli added the blocking-users Issue is blocking some users label May 2, 2019
@vagisha-nidhi
Copy link
Contributor Author

@MarcoRossignoli
We have written an outproc datacollector that references coverlet.core.dll. This calls into coverlet APIs such as coverage.PrepareModules(), coverage.GetCoverageResult(). We get coverage results thus and send these back to testplatform using DataCollectionSink.

The issue I have already mentioned is that datacollector has a dependency on Microsoft.TestPlatform.ObjectModel here which has a dependency on System.Reflection.Metadata, AssemblyVersion=1.4.2.0 here. Due to the datacollector dependency, System.Reflection.Metadata, AssemblyVersion=1.4.2.0 is already loaded and coverlet errors out saying it cannot find System.Reflection.Metadata, AssemblyVersion=1.4.3.0, since it is unable to load System.Reflection.Metadata again.
#329 is a different issue.

@MarcoRossignoli
Copy link
Collaborator

Understood, apart from this issue I'm warning you that we're working on internals to allow better testability and I don't guarantee that "internal api" like coverage.PrepareModules() coverage.GetCoverageResult() will be untouched, to achieve this cc @tonerdo

@tonerdo
Copy link
Collaborator

tonerdo commented May 2, 2019

@vagisha-nidhi like @MarcoRossignoli mentioned the coverlet.core API is subject to change on a whim. Out of curiosity, are you using an unofficial NuGet or a local build of coverlet.core?

@vagisha-nidhi
Copy link
Contributor Author

@tonerdo Yeah. Noted the warning. I have been using a local build of coverlet.core (setting hintpath to coverlet.core dll).

@MarcoRossignoli
Copy link
Collaborator

fixed in #392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking-users Issue is blocking some users
Projects
None yet
Development

No branches or pull requests

3 participants