As it is possible for Assembly.GetEntryAssembly to return null in LibPathResolver::GetSearchLocations, null checking has to be done.
Code should add null handling here from:
yield return Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
to:
var entryAssembly = Assembly.GetEntryAssembly();
if(entryAssembly != null)
{
yield return Path.GetDirectoryName(entryAssembly.Location);
}