Skip to content

coverlet.collector is missing dependencies #672

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
jdanielbioc opened this issue Jan 2, 2020 · 6 comments
Closed

coverlet.collector is missing dependencies #672

jdanielbioc opened this issue Jan 2, 2020 · 6 comments
Labels
as-designed Expected behaviour

Comments

@jdanielbioc
Copy link

Unlisted dependency on old version of FileSystemGlobbing is causing problems starting a project in built in 3.1.

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.FileSystemGlobbing, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'Microsoft.Extensions.FileSystemGlobbing, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.ChangeTokenInfo..ctor
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.ChangeTokenInfo..ctor(CancellationTokenSource tokenSource, CancellationChangeToken changeToken)
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.GetOrAddFilePathChangeToken(String filePath)
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.GetOrAddChangeToken(String pattern)
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch(String filter)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0()
at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration1..ctor(Func1 changeTokenProducer, Action1 changeTokenConsumer, TState state) at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func1 changeTokenProducer, Action changeTokenConsumer)
at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider..ctor(JsonConfigurationSource source)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at Bioclinica.ClinFeed.OrchestrationService.Program.Main(String[] args) in C:\agent-intg_work\51\s\OrchestrationService\Program.cs:line 14

@MarcoRossignoli MarcoRossignoli added the needs more info More details are needed label Jan 2, 2020
@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Jan 2, 2020

Hi @jdanielbioc the issue is not clear to me, this exception seem unrelated to Coverlet, I mean coverlet instruments users asm before run test and restore those at the end, but it should skip non user asm, can you attach the command line you used to run test?
Can you attach also your csproj?
This is our hello word example for collectors https://github.com/tonerdo/coverlet/tree/master/Documentation/Examples/VSTest/HelloWorld

@jdanielbioc
Copy link
Author

jdanielbioc commented Jan 3, 2020 via email

@MarcoRossignoli
Copy link
Collaborator

Can you attach you command line?
When you say publishing you mean dotnet publish and after dotnet vstest lib.dll?

@jdanielbioc
Copy link
Author

jdanielbioc commented Jan 3, 2020 via email

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Jan 3, 2020

Yup when publishing all files are moved to target directory(also coverlet nuget package files) so globbing dll is overwrite. I'm wondering why you don't run test without publishing, only using dotnet test --collect:"XPlat Code Coverage" from root(where sln file is placed) or from test csproj folder, in this way Coverlet files are not copied to output and globbing dll shouldn't be overwrite. I mean publish test projects usually is done only to test with dotnet vstest ..dll and not to deploy to prod, so run test without "publish" should avoid the issue. It's not clear why you run app from test project (I mean the target folder of test project).

@MarcoRossignoli MarcoRossignoli added as-designed Expected behaviour and removed needs more info More details are needed labels Jan 5, 2020
@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Jan 5, 2020

We are not looking to fix that, just the incorrect display of dependencies on nuget.org which made it harder to track down this as the cause.

You're right, unfortunatly coverlet is packed as build assets https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets because it runs before and after tests(imports props and target files) and is not consumed as a lib so nuget ui doesn't show any dependencies because all files are "embedded" and also because it's not a consumed "dependency" for the project is using it.
Btw if possible I advice to use dotnet test ... and not run dotnet publish/dotnet vstest ...dll so libs shouldn't be moved to target folder.

image

For now I'll tag as-designed, I'll do some search to understand if make sense/is possible document in some way from nuget.org site perspective, but for now I don't think that is possible because globbing lib is a reference of an internal(for now) core library(that is not present on nuget) coverlet.core.dll so also if we publish that dependency(no more private assets) you won't see Microsoft.Extensions.FileSystemGlobbing dep. Maybe in future when/if we'll publish core lib standalone we could expose all real deps.

Feel free to close if solved for the moment.

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