LogShipping Error: Unhandled Exception: System.IO.FileLoadException: Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information

You will see the following error in the SQL Agent job history for the LogShipping Job;

Unhandled Exception: System.IO.FileLoadException: Mixed mode assembly is built against version ‘v2.0.50727’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information

This is because SQLLogshipping is trying to use mixed-mode assemblies for .netframework, To use mixed-mode assemblies in .NET Framework 4.0, it must be configured in the configuration file for that application.

SQLServer.exe and SQLAgent. exe applications are in the C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn Directory, here you have the corresponding .config files. However, log shipping is in C:\Program Files\Microsoft SQL Server\130\Tools\Binn which has its own separate application there for its own .config file.

The sqllogship.exe.config file needs to be added to allow legacy v2 runtime, as the following MS Article describes; https://docs.microsoft.com/en-us/troubleshoot/dotnet/framework/sgen-mixed-mode-assembly-built-v2-0-50727

sqllogship.exe.config should look something like this, once modified.

SQL Server & SQL Agent DOES NOT require a reboot for this change to work. just execute the log shipping job again and it should read the new config file (and hopefully work for you.)

Leave a comment