-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Why the nuget library required another library which actually not required? #46182
Comments
@joperezr Still looks like the release policy problem, could you analysis this? |
The same problem for https://www.nuget.org/packages/System.Security.AccessControl/5.0.0 Check the references of packages\System.Security.AccessControl.5.0.0\lib\net461\System.Security.AccessControl.dll, and it did not reference System.Security.Principal.Windows. However the documentation is as following:
|
The following two library dependencies also not required.
https://www.nuget.org/packages/System.Configuration.ConfigurationManager/5.0.0
|
Interesting it does seem like there are some dependencies that might not be required. I have only checked the EventLog package and as you pointed out, it is true that there shouldn't be a dependency onto System.Security.Principal.Windows package. I'll do a deeper investigation into why this is happening. |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @safern, @ViktorHofer Issue DetailsToday when I checked the dependency problem, I found I have multi versions of System.Security.Principal.Windows installed across multi projects in same solution. When I try to uninstall System.Security.Principal.Windows, and I get the error info: When I check the dependency of System.Diagnostics.EventLog.4.7.0 under packages\System.Diagnostics.EventLog.4.7.0\lib\net461\System.Diagnostics.EventLog.dll by dnSpy. When I check the nuget release info https://www.nuget.org/packages/System.Diagnostics.EventLog/4.7.0
|
@joperezr By the way, the .net standard version of System.Diagnostics.EventLog requires System.Security.Principal.Windows. Maybe someone mixed the .net version and .net standard version of System.Diagnostics.EventLog library. |
Dependencies get automatically calculated by our build tooling so this would hardly be a human error, I believe it may instead be a bug in that tooling, which is what I have to investigate |
The first version System.Diagnostics.EventLog 4.5.0-preview1-25914-04 also has the same problem However the difference is, documentation shows it requires another library(actually id did not require)
|
Does it load extra assemblies? If so the repo need to have protection tests for expected dependencies.. |
@joperezr should we assign you this issue? |
sure |
The issue seems to be with our PromoteDependencies Task in arcade. Seems like it is not finding the net4.6.1 ref asset in the package for some reason, causing it to promote the netstandard2.0 dependencies to all of the lib implementations where netstandard2.0 would apply (so this includdes net461) I will have to debug into PromoteDependencies in order to figure out why it doesn't see the net461 ref that is also in the package. |
Hey @chucklu sorry I forgot to update my github status, I'm taking some time off for the rest of the year so won't really have time to look at this until January |
@joperezr Thanks for your update, have a good time. I will follow this issue. |
@joperezr Any update? |
Hey @chucklu I’m back from vacation but I’m looking into other issues at the moment but I have this one on my backlog of things to do. Sorry in advance for the delay. |
@joperezr Another week passed, when are you available to investigate this issue? |
Hey @chucklu sorry for the delay but as I said before this is on my backlog but I don’t expect to be able to take a look at this any time soon. Is this blocking you in some way? I ask because we have some other higher priority items we have to get to first, and this is not currently high in priority given that it is not really considered as breaking customers now and just seems to be an issue with our build infrastructure that we only need to get to before our next release so there is still time to do that. If this is actually breaking you, then we can consider your case to get priorities re-evaluated. |
@joperezr I have found that you are still keep delivering new packages, https://www.nuget.org/packages/System.Diagnostics.EventLog/5.0.1, 6.0.0-preview.2.21154.6 |
The fix for this will go in 6.0 packages, so 5.x version packages will still have this issue. As for the 6.x preview packages, once we fix this issue those should no longer have the problem. |
@joperezr Thanks for the update, |
Based on my understanding, the references to See #52982 and the repro in it for more details. |
@ViktorHofer Interesting, nobody else find my issue. Thanks for your notification, please check my comments in that issue. @ericstj just give a wrong case. |
Hey @chucklu, I took a deeper look at this and @ViktorHofer is right, these references are correct and by design so this is not actually an issue. I may be wrong but I think you haven't fully understand why we add these extra references to the packages on netfx even when netfx asset doesn't depend on it. Basically as my collegues @ericstj and @ViktorHofer have mentioned, the problem here is that because the .NET Standard asset depends on those additional references, the .NET Framework asset must also have a dependency on those packages even when itself doesn't directly depend on them. Let me try to explain why: Imagine the following scenario: I hope this helps clarifying a bit on why we add these package references, but if not feel free to ask any follow up questions. I'll go ahead and close this issue. |
Today when I checked the dependency problem, I found I have multi versions of System.Security.Principal.Windows installed across multi projects in same solution.
And when I tried to figure out the dependent of System.Security.Principal.Windows, I got nothing.
There is no library required System.Security.Principal.Windows.
When I try to uninstall System.Security.Principal.Windows, and I get the error info:
Error Unable to uninstall 'System.Security.Principal.Windows.4.7.0' because 'System.Diagnostics.EventLog.4.7.0' depends on it.
When I check the dependency of System.Diagnostics.EventLog.4.7.0 under packages\System.Diagnostics.EventLog.4.7.0\lib\net461\System.Diagnostics.EventLog.dll by dnSpy.
It's weird, it seems the .net version of System.Diagnostics.EventLog did not require the System.Security.Principal.Windows.
However the .net standard verison packages\System.Diagnostics.EventLog.4.7.0\lib\netstandard2.0\System.Diagnostics.EventLog.dll requires the System.Security.Principal.Windows.
When I check the nuget release info https://www.nuget.org/packages/System.Diagnostics.EventLog/4.7.0
Why the documentation shows the .net version has dependency of System.Security.Principal.Windows?
The text was updated successfully, but these errors were encountered: