System binding Redirect for F # 4.0.0.0 to 4.3.0.0

I have some xUnit tests that do not work with general

Could not load file or assembly 'FSharp.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 

To redirect the entire node, I added to the file

 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> <bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> 

Do you have a better way to solve the 4.0 / 4.3 problem?

+6
source share
2 answers

I do not know xUnit, but if your unit test runner supports app.config files, you can simply attach the configuration to unit test assemblies (for example, app.config along the lines of what you get using the standard F # application template). If the test runner does not comply with app.config, then I think the machine.config strategy is decent.

+3
source

Using NuGet, I added FSharp.Core.3 and it fixed my problem.

+2
source

Source: https://habr.com/ru/post/921650/


All Articles