Binding Redirects

Binding.zip (5.5 MB)
Hi,

When running on windows I seem to end up with a lot of issues like this

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Extensions.Options, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’ or one of its dependencies. The system cannot find the file specified.
at ConsoleApplication14.Program.Main(String[] args)

On my machine the greatest version of Microsoft.Extensions.Options is 3.0.1

Shown below are my references

I also attached what I think is the equivalent vs project.

To fix the Elements project I had to add my own binding redirects, you can see what I added in app.config. Its a bit of a pain because I ran the program from the command line and noted what it complained about and updated app.config.

I’m not really sure what the solution is. Visual studio added the latest versions of referenced assemblies and binding redirects.

I don’t think that would be very nice. I suppose one solution might be to always reference the lowest version or another might be to allow me some way to automatically generate a binding redirect.

Thanks,
John

I’ll have a look after tomorrow’s build is out.

Thanks, logged as bugs://83619

This is really an odd issue. You have:
image

you only reference memory nuget there (v3.0.0) in the c# one you reference quite a few 3.0.1 references yourself:

If I add some of them myself to nuget the error changes:

    <NuGetReference Include="Microsoft.Extensions.Caching.Abstractions:[3.0.1]">
      <Private>True</Private>
    </NuGetReference>

so I think you need to do the same as in c#

bugs://E23688 was closed as no change required.