title: Could not load file or assembly System.Runtime.CompilerServices.Unsafe
body: <p>I created a Visual Studio (Community 2019) project with C# using <code>ServiceStack.Redis</code>. Since it is C#, I use Windows 10 (there is a Redis version for Windows but it is really old and as I know, it is unofficial so I am afraid that might be the problem).
  Here is an excerpt from my code:</p>
  <pre><code>public class PeopleStorage: IDisposable
  {
      public PeopleStorage()
      {
          redisManager = new RedisManagerPool(&quot;localhost&quot;);
          redis = (RedisClient)redisManager.GetClient();
          facts = (RedisTypedClient&lt;List&lt;Fact&gt;&gt;)redis.As&lt;List&lt;Fact&gt;&gt;();
      }
  
      public List&lt;Fact&gt; GetFacts(int id)
      {
          string sid = id.ToString();
          if (facts.ContainsKey(sid))
              return facts[sid];
          return accessor.GetFacts(id);
      }
  
      private RedisTypedClient&lt;List&lt;Fact&gt;&gt; facts;
      private RedisClient redis;
      private RedisManagerPool redisManager;
  }
  </code></pre>
  <p>In an attempt to connect to Redis in line <code>return facts[sid];</code>, an exception occurs:</p>
  <blockquote>
  <p>System.IO.FileLoadException: &quot;Could not load file or assembly
  &quot;System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1,
  Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; or one of it's
  dependences. The found Assembly's manifest definition does not match
  the Assembly reference. (Exception from HRESULT: 0x80131040)&quot;</p>
  </blockquote>
  <p>(May be inaccurate as I have translated it)</p>
  <p>I have tried updating all the packages, starting with <code>ServiceStack</code> packages, ending with <code>System.Runtime.CompilerServices.Unsafe</code> itself. Moreover, you can't choose 4.0.4.1 version in NuGet, the closest one there is 4.0.0, while the relevant is 4.0.7.</p>
  <p>I do not understand why it uses this version and how I can fix this problem.<br />
  Even a clean reinstall of Visual Studio did not help.</p>