Closed BodrickLight closed 5 months ago
I missed the PR but when the target is net462
, the package System.Net.Http.WinHttpHandler
is referenced.
If the target of the consumer is net472
, surely this package will not be pulled in and WinHttpHandler
will not be available?
@jcsawyer this directive #if NETFRAMEWORK
covers all net framework versions (anything not net core effectively), so I'm not sure what the concern is?
@baywet if the package System.Net.Http.WinHttpHandler
is referenced when the target is net462
, will this work for consumers with a target of net472
or will it result in a The type or namespace name 'WinHttpHandler' could not be found
?
I'm suspecting the latter?
The #if NETFRAMEWORK
will resolve the type for net462
but no other NETFRAMEWORK
target?
Ah, you're referring to this
I'm not sure whether other versions of netfx will favour the net462 version or the net standard versions. Maybe this is something that @andrueastman can shed a light on? We might have to update the directive, or the condition for the package.
I am indeed. If I drop:
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="[6.0,9.0)" />
</ItemGroup>
in a net472
project, any references to WinHttpHandler
will fail to build.
Thanks for the additional information. This is a fix we had in the previous version of the microsoft graph sdk for years nad here which only had net462 and netstandard2 targets while net472 was already available for years and we didn't get complaints about missing dependencies?
I believe in the context of a net472
project the package manager will pull the net462
dll and resolve the dependency.
This is validated with the latest https://www.nuget.org/packages/Microsoft.Kiota.Http.HttpClientLibrary/1.3.11 release.
The sample net4.7.2 project builds and runs as expected.
Any chance you can confirm if you are referencing the project as a submodule or as a package?
TIL NET Framework packages are confusing as anything!
It looks like everything is working with the 1.3.11
package - running a full e2e pipeline through on component to fully confirm for specific case, but I can re-open/open new issue if there are any problems there.
Many thanks
Thanks for keeping us in check! Closing
231 introduces a breaking change for consumers that use .NET Framework, as HTTP/2.0 is not a supported version in
HttpRequestMessage
.Minimal repro with
<TargetFramework>net472</TargetFramework>
:This works as expected on
Microsoft.Kiota.Http.HttpClientLibrary
version1.3.8
, but throws the following exception on1.3.9
and1.3.10
: