Commit aa57a367 authored by Marc Gravell's avatar Marc Gravell

check vectors *early*, because: pain, so much pain

parent 23181898
......@@ -965,8 +965,33 @@ internal ServerEndPoint GetServerEndPoint(EndPoint endpoint, TextWriter log = nu
}
internal readonly CommandMap CommandMap;
[MethodImpl(MethodImplOptions.NoInlining)]
private static void CheckNumericsVectors()
{
try
{
DoNothingWith(System.Numerics.Vector.IsHardwareAccelerated, System.Numerics.Vector<int>.Count);
}
catch (Exception ex)
{
throw new InvalidOperationException(
"It looks like there's a problem resolving System.Numerics.Vectors.dll; "
+ "this is a well-known pain point between .NET Framework and .NET Core - "
+ "try adding an explicit package reference to System.Numerics.Vectors; "
+ "and if you're wondering 'why do you need that?' - we actually don't: "
+ "it is a down-stream dependency that we don't need directly, but which "
+ "keeps causing pain.", ex);
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
#pragma warning disable RCS1163 // Unused parameter.
private static void DoNothingWith(bool b, int i) { }
#pragma warning restore RCS1163 // Unused parameter.
private ConnectionMultiplexer(ConfigurationOptions configuration)
{
CheckNumericsVectors();
IncludeDetailInExceptions = true;
IncludePerformanceCountersInExceptions = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment