Could not load file or assembly ‘System.ComponentModel.Annotations, Version=4.1.0.0

In many cases, this can be solved by adding the following code to the csproj file of your test project: <PropertyGroup> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType> </PropertyGroup> This forces the build process to create a .dll.config file in the output directory with the needed binding redirects. The reason is that “classic” csproj test projects are true “libraries” and … Read more