Mavnn's blog

Stuff from my brain

We're running Cloud Native .NET in Brighton, 26th-27th April 2018. High quality training for building .NET Core, distributed, production ready systems.

Strange Errors From the F# Compiler

I found a new error, yesterday:

    error FS0192: internal error: null: GetTRefType

It showed up when I tried to run a .fsx script that referenced NuGet.Core 2.1.0, but only when the script was run on Windows Server 2008 R2. Windows 7 x64? No problems. Windows Server 2003/8 x86? No problems.

2008 R2? Bam. Every time.

A bit of trial of error discovered two things:

The error went away if I referenced NuGet.Core 2.2.0 alpha 4

And the minimal error case is pretty minimal:

Looking at the NuGet.Core source ( ) the only thing that might be a relevant change that I can see is a simplification of some custom GetHashCode logic.

Raising the interesting question of why there is custom GetHashCode logic in the first place, and how the heck did they get it to cause internal F# compiler errors anyway? And why did it only fail on that one specific version of Windows?

All very strange. Hopefully 2.2.0 will be a full release before we want to start using this technique for in our production code!