I have a .net standard 1.4 project, which I link to a project link from a .net 4.6.1 project.
When I run, I get the following message:
System.IO.FileNotFoundException: 'Failed to load file or assembly' System.Threading.Thread, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a 'or one of its dependencies. The system cannot find the specified file. ''
I can get around this by referring to the nuget package for System.Threading.Thread version 4.3.0. But for some reason this is actually version 4.0.1.0, which then means that I need a binding redirect.
Adding a binding redirect allows me to bypass this problem and move on to the next. What is:
System.IO.FileNotFoundException: 'Could not load file or assembly' System.IO.FileSystem, Version = 4.0.1.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a 'or one of its dependencies. The system cannot find the specified file. ''
Do I need to manually add packages (and potentially redirects) for all the dependencies of my standard .net packages? It does not seem to have been sold. What is the meaning of the .net standard, if I have to send all the assemblies that it needs, even through them are already included in the GAC in the .net infrastructure that I am aiming at. I donβt see how it can be sold, because .net standard 1.4 is compatible with .net 4.6.1, if by compatibility you mean, if you do not use .net 4.6.1 of the BCL library.
The next question seems to be related to https://github.com/NuGet/Home/issues/4488 However, I tried the proposed job there. What you need to add:
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
to the .net project 4.6.1. I tried this and it didn't matter.
UPDATE After adding the following to the .net 4.6.1 project:
<PackageReference Include="Legacy2CPSWorkaround" Version="1.0.0"> <PrivateAssets>All</PrivateAssets> </PackageReference>
Now I have System.IO.FileSystem in my output directory, but its version is incorrect. He is 4.0.2.0. Again I can solve this using binding redirection, but I don't need to.
I do not know where this version 4.0.2.0 came from, because it is not in the folder of my package, so it cannot be obtained from nuget?