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.

System.Net.Http and System.IO.Compression .NET Standard facades need to be included when targeting .NET 4.7.1

See original GitHub issue

.NET 4.7.1 ships with support for the .NET Standard 2.0 APIs, as well as the necessary facades. So it’s not supposed to need any facades injected by the ImplicitlyExpandNETStandardFacades target.

However, the in-box assembly versions of System.Net.Http and System.IO.Compression are less than the OOB and facade versions of those libraries. This will be fixed in .NET 4.7.2, however for 4.7.1, we still need to inject just those two facades as necessary.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
steevcococommented, Dec 27, 2017

Hi. I have had trouble getting a project working for reasons surrounding these binding issues. I wanted to add a comment now that the project seems to work: it was not simple to get it working, and I had to find the right recipe.

  • It is Framework 4.7.1.
    • References a NetStandard 2.0 project.
      • That one references NuGet System.Configuration.ConfigurationManager 4.4.1

VS would not build, and eventually I get “you need to reference System.Configuration.ConfigurationManager 4.0.0.0”. — Version is interesting?

When I add to the Framework project, NuGet ConfigurationManager 4.4.1, that project file now contains:

<Reference Include="System.Configuration.ConfigurationManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
  <HintPath>..\..\..\..\..\packages\System.Configuration.ConfigurationManager.4.4.1\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
</Reference>

… Which are odd version numbers?

Eventually I had to also add

<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

And now it is working. And there is another similar thing in the same project:

  • This Framework 4.7.1.
    • References a NetStandard 2.0 project.
      • That one references System.ComponentModel.Annotations 4.4.1

… And I added NuGet System.ComponentModel.Annotations 4.4.1. And the Framework project file now contains:

<Reference Include="System.ComponentModel.Annotations, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
  <HintPath>..\..\..\..\..\packages\System.ComponentModel.Annotations.4.4.1\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
</Reference>

I just wanted to add a comment because it was not simple to get it working: if you do or don’t add the AutoGenerateBindingRedirects, and do or don’t add the NuGet references, you get different failures, and different suggestions. I had to come to this recipe to see it working.

0reactions
livarcocccommented, Feb 12, 2018

@eriawan VS 15.6. SDK will be 2.1.100.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - How do I prevent .NET 4.7.1 libraries from copying the ...
NET 4.7.1. I added some dummy code to the project to make use of Sysetem.IO.Compression and System.Net.Http namespaces. I added a reference ...
Read more >
System.Net.Http is driving me insane. : r/csharp
NET 4.7.1, I've had a torrent of issues with System.Net.Http .dll ... Http and System.IO.Compression to be compatible with netstandard 2.0 ...
Read more >
Port from .NET Framework to .NET 7 - .NET Core
This article provides an overview of what you should consider when porting your code from .NET Framework to .NET (formerly named .NET Core)....
Read more >
Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
Read more >
mono-devel-6.8.0-bp153.1.194 RPM for x86_64
Its objective is to enable Unix developers to build and deploy cross-platform .NET applications. This package contains compilers and other tools ...
Read more >

github_iconTop Related Medium Post

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