-
Notifications
You must be signed in to change notification settings - Fork 533
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
Dependency warnings with Google.Apis.Auth 1.63.0 or higher #2596
Comments
This is the sort of internal version of googleapis#2596 - but this only fixes the support build, not applications depending on the auth library.
I'll take a look later this week. |
This is the sort of internal version of #2596 - but this only fixes the support build, not applications depending on the auth library.
The warning for System.CodeDom |
That's good to know. We should look into the System.Net.Http warning at some point, although it's not clear what we'll be able to do about it. |
The warning for System.Net.Http in .NET 4.6.2 is a weird one. Consider the following code:
And now, running the code in the 3 following projects we get the following output: Project 1, .NET 4.6.1, Dependency on Google.Apis.Auth 1.63.0<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Apis.Auth" Version="1.63.0" />
</ItemGroup>
</Project> Output:
The System.Net.Http dependency is 4.2.0 and the loaded assembly is also 4.2.0 from the bin folder. Project 2, .NET 4.6.2, Dependency on Google.Apis.Auth 1.63.0<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net462</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Apis.Auth" Version="1.63.0" />
</ItemGroup>
</Project> Output:
The System.Net.Http dependency is 4.0.0 and the loaded assembly is also 4.0.0 from GAC. Here's where we get a warning as Google.Apis.Auth depends on System.Net.Http 4.2.0 Project 3 .NET 4.8, Dependency on Google.Apis.Auth 1.63.0<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Apis.Auth" Version="1.63.0" />
</ItemGroup>
</Project> Output
The System.Net.Http dependency is 4.2.0 but the loaded assembly is 4.0.0 from GAC. We don't get a warning here, both Google.Apis.Auth and this project depend on the same version of System.Net.Http. @jskeet I'm not really certain what's happening here, in particular why the console app resolves correctly to System.Net.Http 4.2.0 dependency for target .NET 4.6.1 but incorrectly to System.Net.Http 4.0.0 for target .NET 4.6.2. |
Nope, no ideas I'm afraid. Really, really odd. It may resolve itself when we change our targets... probably something to look into more at that point. |
Yes, I thought about moving to the package reference, but then I found this tini-tiny comment from MS discouraging that. I'm downgrading this to P3, and leave open so we remember to check when we change our targets. Or at least figuring it out may get simpler. |
Interestingly, we're getting the System.Net.Http warning when building Google.Cloud.Storage.V1 now - I'm sure we didn't get that before. This may well be an SDK change though, rather than a library change... |
Just as a thought, might the newness of the warning in 1.63.0 be related to the introduction of a System.Management dependency for the BIOS bit? |
Yes, and you even said so when you created the issue :) "The System.CodeDom warning is because of the System.Management dependency introduced in 1.63.0 for ComputeCredential. It's not clear how/whether we can disable it for end users." When I tested with .NET 4.6.2, the warning disappeared, so I think we are fine on this front. Referencing just the project has never produced the warning, but I'll see if I have time to generate a .Nuget package later from #2608 and confirm that the warning are gone. The System.Net.Http warning is the one that is a little but more puzzling. |
Sorry, yes, that's the one I meant. Not sure if that's somehow related to System.Management in a weird way. |
From the two warnings that this issue covers: .NET 4.6.1: System.CodeDom 7.0.0 doesn't support net461 and has not been tested with it.
.NET 4.6.2: Conflicts for System.Net.Http (4.0.0.0 vs 4.2.0.0)
I'll send a PR for removing the warning suppressions and after I propose we close this issue. @jskeet any thoughts? |
I've got an old project which I'm sure used to generate the warning - and now doesn't, even with the old dependencies. So I suspect this is actually a .NET SDK issue that's been resolved. So yes, I agree :) |
Yep, this is how I tested it as well, I had a console project that I used to see the warnings and investigate, and now I can't (except as described in this comment). |
Consider a simple project:
This generates different warnings depending on the target framework:
(I thought I saw it when targeting net6.0 as well, but I can't reproduce that now.)
The System.CodeDom warning is because of the System.Management dependency introduced in 1.63.0 for ComputeCredential. It's not clear how/whether we can disable it for end users.
It looks like the System.Net.Http warning may be longstanding - again, I don't know how to resolve it.
The text was updated successfully, but these errors were encountered: