question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CPVM seems not to take FrameworkReferences into account

See original GitHub issue

@MichaeIDietrich commented on Sun, 29 Nov 2020 11:24:59 GMT

Description

Projects that use central package version management can produce different DLLs in the output if there is a project that uses PackageReference for a specific dependency while another uses FrameworkReference indirectly for the same dependency.

Steps to reproduce

  1. Clone this repository: https://github.com/MichaeIDietrich/TestCpvmWithFrameworkReferences
    • One project references Microsoft.Extensions.DependencyInjection.Abstractions directly using the related NuGet package while the other project references this assembly indirectly by using ASP.NET Core FrameworkReference
  2. Open cmd.exe in the repo root folder
  3. Run dotnet publish

Actual behavior

If you check the publish folder (%Project name%\bin\Debug\netcoreapp3.1\win-x64\publish) of both projects and inspect the details of Microsoft.Extensions.DependencyInjection.Abstractions.dll, you will see that the DLLs are different:

For project LibraryUsingServiceProvider

InternalName:     Microsoft.Extensions.DependencyInjection.Abstractions.dll
OriginalFilename: Microsoft.Extensions.DependencyInjection.Abstractions.dll
FileVersion:      3.100.920.47302
FileDescription:  Microsoft.Extensions.DependencyInjection.Abstractions
Product:          Microsoft .NET Extensions
ProductVersion:   3.1.9+d8a50ea1cc9892cda13c5237dec402ca10ddeaa1
Size:             36.8 KB

For project WebProject

InternalName:     Microsoft.Extensions.DependencyInjection.Abstractions.dll
OriginalFilename: Microsoft.Extensions.DependencyInjection.Abstractions.dll
FileVersion:      3.100.920.47302
FileDescription:  Microsoft.Extensions.DependencyInjection.Abstractions
Product:          Microsoft .NET Extensions
ProductVersion:   3.1.9+d8a50ea1cc9892cda13c5237dec402ca10ddeaa1
Size:             70.8 KB

Both have different sizes!

Expected behavior

Resulting DLLs for projects that use central NuGet package version management are identical.

Version info

dotnet SDK version: 5.0.100

Windows version: 20H2 (Build 19042.630)

Details about the problem

The reason for this might be that the NuGet package uses a .NET Standard 2.0 variant while the ASP.NET Core Framework has a .NET Core 3.1 variant of this DLL.

Is there a way to resolve this mismatch? Currently we have problems with publishing, since we expect all projects to have identical DLLs when building the installer, since all files will end up in the same installation folder. We have found no real way to determine which DLL we should pick, since both have identical version information.

At the moment we work around this issue by adding the ASP.NET Core FrameworkReference as dependency to all top level projects, but I hope there is a better way to resolve this.

Can you please help us with this issue?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
joeloffcommented, Jan 11, 2021

I am taking a look @MichaeIDietrich On first glance it appears that the size difference is because the one DLL is cross gen’d. Framework references follow a different path AFAIK. I hope to have more detailed answers for you soon.

0reactions
joeloffcommented, Jan 20, 2021

Let me take a closer look and get back to you. I suspect though that if you flip the package references that it would select the netstandard copy. Likely because they’re of equal version and it simply selects the first one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing Central Package Management - The NuGet Blog
Central Package Management. Dependency management is a core feature of NuGet. Managing dependencies for a single project can be easy.
Read more >
The Storage Access Framework is the only way for apps to ...
2.5M subscribers in the Android community. ... Apps will not get "access to full filesystem", they only get access to ... u/cpvm-0 avatar....
Read more >
Ductility limit prediction for polycrystalline aggregates using ...
The developed CPFEM-based framework is well suited to account for essential microstructural features: pre-existence of spherical voids, crystallographic and ...
Read more >
High Resolution Surface Reconstruction from Multi-view Aerial ...
Abstract—This paper presents a novel framework for surface reconstruction from multi-view aerial imagery of large scale ur-.
Read more >
Exploration of Enterprise Server Data to Assess Ease of ...
this regard, user logins to systems do not exhibit an apparent pattern on most servers which indicating the difficulty of modeling logon ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found