Reputation: 11740
I'm working on a project, to which I would like to add Prometheus metrics exporting. There's a pretty great library for it over at NuGet that I've used. The new version (2.0.x, prerelease), however, is supposedly build for .NET Standard. That's fine, but my current project is built for the .NET Framework on Windows. When I add this NuGet package, however, I get over 100 assemblies added to the output of my project, including many that I don't think are related.
I added an issue for this to the project, but the project maintainer came to the conclusion that this is normal. I don't agree, however, and I'd like to know if there is a specific suggestion I can make to improve the situation.
What should prometheus-net change to avoid adding all these assemblies to the output of my project?
Upvotes: 1
Views: 345
Reputation: 11740
This is a flaw/bug/unfortunate side effect of the current .NET Standard 2.0 build situation. When a .NET Framework before 4.7.1 is targeted, the system cannot be sure that all the dependencies exist, so it copies all of these extra assemblies to the output.
4.7.1 has everything that .NET Standard 2.0 needs, so they will not be included if that framework is targeted (though, things might break if an earlier framework is used at runtime).
There is information (and a workaround that seems to work for me) at https://github.com/dotnet/standard/issues/415#issuecomment-314288712
Upvotes: 1