Open qlikTERror opened 1 year ago
On the other side from further tests, setting CopyLocalLockFileAssemblies
at true for every project will make netstandard2.0 projects reach final build directory. So for example netstandard2.0 System.Reflection.DispatchProxy that is not supported in .NET standard will be run instead of the platform specific one.
And this is another problem too.
In our test projects when not using flag
CopyLocalLockFileAssemblies
at true the taskResolveAssemblyReference
produces a different list ofSuggestedBindingRedirects
that turns into a different projectapp.config
file. And you need to set it to true on each project direct or transient dependency.In this test project examples, the test project is built under net4.8.
Example of
SuggestedBindingRedirects
withCopyLocalLockFileAssemblies
at false:Example of
SuggestedBindingRedirects
withCopyLocalLockFileAssemblies
at true:These depends on the fact that with
CopyLocalLockFileAssemblies
at false on each projects, the final test project when it runs the taskResolveAssemblyReference
and tries to resolve the references obtains many of them in this status:When this happens, due to the fact that the task could not find the assembly it is not able to read its dependencies and act according to it.
And there is another problem related to transient dependencies of project dependency. For example in the previous good list of
SuggestedBindingRedirects
, the assembly System.Memory has been resolved to version 4.0.1.2 just because it has been added as a direct dependency of the test project. If I will remove it and let the test project build with theCopyLocalLockFileAssemblies
at true (for each project) I will obtain this:But if we look at the build of the referenced project Qlik.Reporting.AddIn.dll, for which System.Memory is still not a direct dependency and that is a netstandard2.0, we will find:
In this project, System.Memory enters in the build during the execution of the task
ResolvePackageAssets
and is present in its project.assets.json (due to the fact that it is a netstandard2.0???)The interesting part is that even in the test project it is present in the
ResolvePackageAssets
with the correct version but discarded for some reason later.I could not produce a working example, but my idea is: if each dependency and transient dependency project is correctly generating its binding redirects even when
CopyLocalLockFileAssemblies
is set at false, why the generation for the final project is not just a merge of all of them?If you need other informations or log I can produce them on request