If you have been developing software for a while, you should already realize how essential unit testing is for your project. However, for F# programmer, Visual Studio doesn’t come with F# Unit Test Project. As F# is one of CLI languages, you can either use C# Unit Test Project or use F# syntax to test your F# code instead.
You can easily grab the FsUnit by using NuGet (FsUnit comes with NUnit by default, but it also supports MbUnit, xUnit, and MsTest).
But when you create a F# project on Visual Studio 2013 and run the FsUnit tests for the first time, you might see this error message with red unit test:
“System.IO.FileLoadException : Could not load file or assembly ‘FSharp.Core, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)”
The easiest way to fix it is to add bindingRedirect to the configuration file (i.e., app.config or web.config).
<dependentAssembly> <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="184.108.40.206" newVersion="220.127.116.11" /> </dependentAssembly>
And it should resolve your issue.