Skip navigation

I recently moved a RavenDB database from a VM with Windows Server 2012 to a new VM with Windows Server 2016 by way of a dump file because I wanted everything to be fresh. Once the import was complete and the new RavenDB installation tried to index my documents using the old indexes I had constructed, I saw this error pop up in the log dozens of times: Common Language Runtime detected an invalid program.

Luckily, I managed to find that one obscure post in the RavenDB Google Group that pointed me in the direction of the solution, which is to force RavenDB to use the old JIT compiler instead of the new RyuJIT that runs by default with .NET Framework 4.6 installations.

In your RavenDB directory, edit  Raven.Server.exe.config and ensure that <useLegacyJit enabled="1" /> is in the <runtime> section, like so: