title: "Can not resolve reference: `System.Memory`" or "Could not find `System.Memory`" after update to Visual Studio 2017 version 15.8 Preview
body: <p>In case it might help anyone else, I'll ask and answer this little question about an issue that can appear in Xamarin.Android and Xamarin.iOS projects after an update from Visual Studio 2017 version 15.7 to version 15.8 Preview.</p>
  
  <h3>Example steps to demonstrate the issue</h3>
  
  <ol>
  <li>Create a new blank Xamarin.Android or Xamarin.iOS project.</li>
  <li>Add the Microsoft.AspNetCore.SignalR.Client.Core version 1.0.0 NuGet package to the project.</li>
  <li><p>Use a type from the NuGet package in the project. For example, add the following line to any existing method:</p>
  
  <pre><code>var connection = new Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilder().Build();
  </code></pre></li>
  <li><p>For Xamarin.Android, attempt to build the project in the Debug configuration. For Xamarin.iOS, build and run the app in the Debug configuration on iPhone simulator.</p></li>
  </ol>
  
  <h3>Results with Visual Studio 2017 version 15.7</h3>
  
  <p>Both the Xamarin.Android app and the Xamarin.iOS app build and run without error.</p>
  
  <h3>Results with Visual Studio 2017 version 15.8 Preview 4</h3>
  
  <p>For Xamarin.Android, the build fails:</p>
  
  <pre><code>Xamarin.Android.Common.targets(1831,2): error XA2002: Can not resolve reference: `System.Memory`, referenced by `Microsoft.AspNetCore.Connections.Abstractions`. Please add a NuGet package or assembly reference for `System.Memory`, or remove the reference to `Microsoft.AspNetCore.Connections.Abstractions`.
  Xamarin.Android.Common.targets(1831,2): error XA2002: Can not resolve reference: `System.Memory`, referenced by `Microsoft.AspNetCore.SignalR.Client.Core`. Please add a NuGet package or assembly reference for `System.Memory`, or remove the reference to `Microsoft.AspNetCore.SignalR.Client.Core`.
  Xamarin.Android.Common.targets(1831,2): error XA2002: Can not resolve reference: `System.Memory`, referenced by `Microsoft.AspNetCore.SignalR.Common`. Please add a NuGet package or assembly reference for `System.Memory`, or remove the reference to `Microsoft.AspNetCore.SignalR.Common`.
  Xamarin.Android.Common.targets(1831,2): error XA2002: Can not resolve reference: `System.Memory`, referenced by `Microsoft.AspNetCore.SignalR.Protocols.Json`. Please add a NuGet package or assembly reference for `System.Memory`, or remove the reference to `Microsoft.AspNetCore.SignalR.Protocols.Json`.
  Xamarin.Android.Common.targets(1831,2): error XA2002: Can not resolve reference: `System.Memory`, referenced by `Microsoft.Extensions.Primitives`. Please add a NuGet package or assembly reference for `System.Memory`, or remove the reference to `Microsoft.Extensions.Primitives`.
  Xamarin.Android.Common.targets(1831,2): error XA2002: Can not resolve reference: `System.Memory`, referenced by `System.IO.Pipelines`. Please add a NuGet package or assembly reference for `System.Memory`, or remove the reference to `System.IO.Pipelines`.
  </code></pre>
  
  <p>For Xamarin.iOS, the app launches successfully on the simulator, but the debug output shows that the app fails to find System.Memory when it's running:</p>
  
  <pre><code>Could not find `System.Memory` referenced by assembly `System.IO.Pipelines, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51`.
  Could not find `System.Memory` referenced by assembly `Microsoft.AspNetCore.SignalR.Client.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60`.
  Could not find `System.Memory` referenced by assembly `Microsoft.AspNetCore.SignalR.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60`.
  Could not find `System.Memory` referenced by assembly `Microsoft.Extensions.Primitives, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60`.
  Could not find `System.Memory` referenced by assembly `Microsoft.AspNetCore.Connections.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60`.
  Could not find `System.Memory` referenced by assembly `Microsoft.AspNetCore.SignalR.Protocols.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60`.
  </code></pre>
  
  <p>How do I resolve these errors? As a follow-up, why did these errors appear after I updated Visual Studio?</p>