“Can not resolve reference: `System.Memory`” or “Could not find `System.Memory`” after update to...












8















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.



Example steps to demonstrate the issue




  1. Create a new blank Xamarin.Android or Xamarin.iOS project.

  2. Add the Microsoft.AspNetCore.SignalR.Client.Core version 1.0.0 NuGet package to the project.


  3. Use a type from the NuGet package in the project. For example, add the following line to any existing method:



    var connection = new Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilder().Build();


  4. 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.



Results with Visual Studio 2017 version 15.7



Both the Xamarin.Android app and the Xamarin.iOS app build and run without error.



Results with Visual Studio 2017 version 15.8 Preview 4



For Xamarin.Android, the build fails:



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`.


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:



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`.


How do I resolve these errors? As a follow-up, why did these errors appear after I updated Visual Studio?










share|improve this question



























    8















    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.



    Example steps to demonstrate the issue




    1. Create a new blank Xamarin.Android or Xamarin.iOS project.

    2. Add the Microsoft.AspNetCore.SignalR.Client.Core version 1.0.0 NuGet package to the project.


    3. Use a type from the NuGet package in the project. For example, add the following line to any existing method:



      var connection = new Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilder().Build();


    4. 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.



    Results with Visual Studio 2017 version 15.7



    Both the Xamarin.Android app and the Xamarin.iOS app build and run without error.



    Results with Visual Studio 2017 version 15.8 Preview 4



    For Xamarin.Android, the build fails:



    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`.


    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:



    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`.


    How do I resolve these errors? As a follow-up, why did these errors appear after I updated Visual Studio?










    share|improve this question

























      8












      8








      8


      1






      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.



      Example steps to demonstrate the issue




      1. Create a new blank Xamarin.Android or Xamarin.iOS project.

      2. Add the Microsoft.AspNetCore.SignalR.Client.Core version 1.0.0 NuGet package to the project.


      3. Use a type from the NuGet package in the project. For example, add the following line to any existing method:



        var connection = new Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilder().Build();


      4. 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.



      Results with Visual Studio 2017 version 15.7



      Both the Xamarin.Android app and the Xamarin.iOS app build and run without error.



      Results with Visual Studio 2017 version 15.8 Preview 4



      For Xamarin.Android, the build fails:



      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`.


      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:



      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`.


      How do I resolve these errors? As a follow-up, why did these errors appear after I updated Visual Studio?










      share|improve this question














      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.



      Example steps to demonstrate the issue




      1. Create a new blank Xamarin.Android or Xamarin.iOS project.

      2. Add the Microsoft.AspNetCore.SignalR.Client.Core version 1.0.0 NuGet package to the project.


      3. Use a type from the NuGet package in the project. For example, add the following line to any existing method:



        var connection = new Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilder().Build();


      4. 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.



      Results with Visual Studio 2017 version 15.7



      Both the Xamarin.Android app and the Xamarin.iOS app build and run without error.



      Results with Visual Studio 2017 version 15.8 Preview 4



      For Xamarin.Android, the build fails:



      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`.


      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:



      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`.


      How do I resolve these errors? As a follow-up, why did these errors appear after I updated Visual Studio?







      xamarin xamarin.ios xamarin.android






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 12 '18 at 3:10









      Brendan ZagaeskiBrendan Zagaeski

      2,38231432




      2,38231432
























          2 Answers
          2






          active

          oldest

          votes


















          5















          How do I resolve these errors?




          To resolve these errors, update the Microsoft.AspNetCore.SignalR.Client.Core NuGet package to version 1.0.1 or higher in all the projects that use it. For example:




          1. Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution > Updates.


          2. Update Microsoft.AspNetCore.SignalR.Client.Core to version 1.0.1 or higher.



          In Microsoft.AspNetCore.SignalR.Client.Core version 1.0.1, the System.Memory NuGet dependency is now (>= 4.5.1) rather than (>= 4.5.0). And because System.Memory version 4.5.1 no longer includes placeholder files for Xamarin project types, Xamarin projects will now use the .NET Standard 2.0 assembly directly from the NuGet package. This solves the errors because the Xamarin projects can now successfully locate the System.Memory reference.




          As a follow-up, why did these errors appear after I updated Visual Studio?




          The errors appeared because the Xamarin SDK versions in Visual Studio 2017 version 15.7 and version 15.8 have a tricky compatibility relationship with the System.Memory NuGet package versions. In Visual Studio 2017 version 15.7, Xamarin.Android and Xamarin.iOS use their own built-in implementations of the types from that NuGet package, so they don't need to reference the assembly from the NuGet package. The System.Memory NuGet package version 4.5.0 accordingly includes placeholder files for Xamarin project types to prevent conflicts.



          But the built-in implementations in the current Xamarin SDK releases do not yet cover the full surface area of the NuGet package. So for Visual Studio 2017 version 15.8, the Mono team temporarily hid those built-in implementations (by switching them to internal and removing the System.Memory facade assembly). This means that Xamarin projects now depend on the implementations from the NuGet package instead. And the System.Memory NuGet package version 4.5.1 accordingly does not include placeholder files for Xamarin project types.



          One more thing to keep in mind is that the built-in implementations in the Xamarin SDKs will cover the full surface area of the NuGet package in a future release. The built-in implementations will then be un-hidden and the placeholder files will be added back to the NuGet package. Users will need to update their NuGet packages once more when that happens. That next change will be coming in Visual Studio 2017 version 15.9 or later.






          share|improve this answer
























          • This is terrible. I've just upgraded Visual Studio to 15.8, and now my Xamarin build is completely broken (Unfortunately, installing SignalR didn't work). Does this mean I have to wait until V 15.9 for it to work again?

            – Rob Lyndon
            Aug 14 '18 at 22:38











          • @RobLyndon, as a clarification, it sounds like your project was not using any version of SignalR before? This question + answer is in particular for projects that were already using SignalR. But the same kind of issue can occur for any NuGet package that depends on the System.Memory NuGet package. The key thing is that you will need to update the System.Memory NuGet package in all of the projects in your solution to version 4.5.1 or higher to be compatible with the Xamarin SDK versions in Visual Studio 2017 version 15.8. Do you have any versions of System.Memory lower than 4.5.1 left?

            – Brendan Zagaeski
            Aug 15 '18 at 16:35













          • I don't think so, but I'll check my bin folders.

            – Rob Lyndon
            Aug 15 '18 at 17:37






          • 1





            Ah, that's interesting. Visual Studio was adding System.Memory from the GAC, but I added a HintPath in the fsproj file, pointing it to the dll in my packages folder. Thanks for your help.

            – Rob Lyndon
            Aug 15 '18 at 17:48



















          3














          I use VS Entreprise 2017 Version 15.9.1



          To solve the problem I face ( Can not resolve reference: System.Buffers, referenced by System.Memory. Please add a NuGet package or assembly reference for System.Buffers, or remove the reference to System.Memory.),
          I just install System.Buffers package by this command:



          Install-Package System.Buffers -Version 4.5.0



          https://www.nuget.org/packages/System.Buffers/






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51296773%2fcan-not-resolve-reference-system-memory-or-could-not-find-system-memory%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            5















            How do I resolve these errors?




            To resolve these errors, update the Microsoft.AspNetCore.SignalR.Client.Core NuGet package to version 1.0.1 or higher in all the projects that use it. For example:




            1. Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution > Updates.


            2. Update Microsoft.AspNetCore.SignalR.Client.Core to version 1.0.1 or higher.



            In Microsoft.AspNetCore.SignalR.Client.Core version 1.0.1, the System.Memory NuGet dependency is now (>= 4.5.1) rather than (>= 4.5.0). And because System.Memory version 4.5.1 no longer includes placeholder files for Xamarin project types, Xamarin projects will now use the .NET Standard 2.0 assembly directly from the NuGet package. This solves the errors because the Xamarin projects can now successfully locate the System.Memory reference.




            As a follow-up, why did these errors appear after I updated Visual Studio?




            The errors appeared because the Xamarin SDK versions in Visual Studio 2017 version 15.7 and version 15.8 have a tricky compatibility relationship with the System.Memory NuGet package versions. In Visual Studio 2017 version 15.7, Xamarin.Android and Xamarin.iOS use their own built-in implementations of the types from that NuGet package, so they don't need to reference the assembly from the NuGet package. The System.Memory NuGet package version 4.5.0 accordingly includes placeholder files for Xamarin project types to prevent conflicts.



            But the built-in implementations in the current Xamarin SDK releases do not yet cover the full surface area of the NuGet package. So for Visual Studio 2017 version 15.8, the Mono team temporarily hid those built-in implementations (by switching them to internal and removing the System.Memory facade assembly). This means that Xamarin projects now depend on the implementations from the NuGet package instead. And the System.Memory NuGet package version 4.5.1 accordingly does not include placeholder files for Xamarin project types.



            One more thing to keep in mind is that the built-in implementations in the Xamarin SDKs will cover the full surface area of the NuGet package in a future release. The built-in implementations will then be un-hidden and the placeholder files will be added back to the NuGet package. Users will need to update their NuGet packages once more when that happens. That next change will be coming in Visual Studio 2017 version 15.9 or later.






            share|improve this answer
























            • This is terrible. I've just upgraded Visual Studio to 15.8, and now my Xamarin build is completely broken (Unfortunately, installing SignalR didn't work). Does this mean I have to wait until V 15.9 for it to work again?

              – Rob Lyndon
              Aug 14 '18 at 22:38











            • @RobLyndon, as a clarification, it sounds like your project was not using any version of SignalR before? This question + answer is in particular for projects that were already using SignalR. But the same kind of issue can occur for any NuGet package that depends on the System.Memory NuGet package. The key thing is that you will need to update the System.Memory NuGet package in all of the projects in your solution to version 4.5.1 or higher to be compatible with the Xamarin SDK versions in Visual Studio 2017 version 15.8. Do you have any versions of System.Memory lower than 4.5.1 left?

              – Brendan Zagaeski
              Aug 15 '18 at 16:35













            • I don't think so, but I'll check my bin folders.

              – Rob Lyndon
              Aug 15 '18 at 17:37






            • 1





              Ah, that's interesting. Visual Studio was adding System.Memory from the GAC, but I added a HintPath in the fsproj file, pointing it to the dll in my packages folder. Thanks for your help.

              – Rob Lyndon
              Aug 15 '18 at 17:48
















            5















            How do I resolve these errors?




            To resolve these errors, update the Microsoft.AspNetCore.SignalR.Client.Core NuGet package to version 1.0.1 or higher in all the projects that use it. For example:




            1. Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution > Updates.


            2. Update Microsoft.AspNetCore.SignalR.Client.Core to version 1.0.1 or higher.



            In Microsoft.AspNetCore.SignalR.Client.Core version 1.0.1, the System.Memory NuGet dependency is now (>= 4.5.1) rather than (>= 4.5.0). And because System.Memory version 4.5.1 no longer includes placeholder files for Xamarin project types, Xamarin projects will now use the .NET Standard 2.0 assembly directly from the NuGet package. This solves the errors because the Xamarin projects can now successfully locate the System.Memory reference.




            As a follow-up, why did these errors appear after I updated Visual Studio?




            The errors appeared because the Xamarin SDK versions in Visual Studio 2017 version 15.7 and version 15.8 have a tricky compatibility relationship with the System.Memory NuGet package versions. In Visual Studio 2017 version 15.7, Xamarin.Android and Xamarin.iOS use their own built-in implementations of the types from that NuGet package, so they don't need to reference the assembly from the NuGet package. The System.Memory NuGet package version 4.5.0 accordingly includes placeholder files for Xamarin project types to prevent conflicts.



            But the built-in implementations in the current Xamarin SDK releases do not yet cover the full surface area of the NuGet package. So for Visual Studio 2017 version 15.8, the Mono team temporarily hid those built-in implementations (by switching them to internal and removing the System.Memory facade assembly). This means that Xamarin projects now depend on the implementations from the NuGet package instead. And the System.Memory NuGet package version 4.5.1 accordingly does not include placeholder files for Xamarin project types.



            One more thing to keep in mind is that the built-in implementations in the Xamarin SDKs will cover the full surface area of the NuGet package in a future release. The built-in implementations will then be un-hidden and the placeholder files will be added back to the NuGet package. Users will need to update their NuGet packages once more when that happens. That next change will be coming in Visual Studio 2017 version 15.9 or later.






            share|improve this answer
























            • This is terrible. I've just upgraded Visual Studio to 15.8, and now my Xamarin build is completely broken (Unfortunately, installing SignalR didn't work). Does this mean I have to wait until V 15.9 for it to work again?

              – Rob Lyndon
              Aug 14 '18 at 22:38











            • @RobLyndon, as a clarification, it sounds like your project was not using any version of SignalR before? This question + answer is in particular for projects that were already using SignalR. But the same kind of issue can occur for any NuGet package that depends on the System.Memory NuGet package. The key thing is that you will need to update the System.Memory NuGet package in all of the projects in your solution to version 4.5.1 or higher to be compatible with the Xamarin SDK versions in Visual Studio 2017 version 15.8. Do you have any versions of System.Memory lower than 4.5.1 left?

              – Brendan Zagaeski
              Aug 15 '18 at 16:35













            • I don't think so, but I'll check my bin folders.

              – Rob Lyndon
              Aug 15 '18 at 17:37






            • 1





              Ah, that's interesting. Visual Studio was adding System.Memory from the GAC, but I added a HintPath in the fsproj file, pointing it to the dll in my packages folder. Thanks for your help.

              – Rob Lyndon
              Aug 15 '18 at 17:48














            5












            5








            5








            How do I resolve these errors?




            To resolve these errors, update the Microsoft.AspNetCore.SignalR.Client.Core NuGet package to version 1.0.1 or higher in all the projects that use it. For example:




            1. Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution > Updates.


            2. Update Microsoft.AspNetCore.SignalR.Client.Core to version 1.0.1 or higher.



            In Microsoft.AspNetCore.SignalR.Client.Core version 1.0.1, the System.Memory NuGet dependency is now (>= 4.5.1) rather than (>= 4.5.0). And because System.Memory version 4.5.1 no longer includes placeholder files for Xamarin project types, Xamarin projects will now use the .NET Standard 2.0 assembly directly from the NuGet package. This solves the errors because the Xamarin projects can now successfully locate the System.Memory reference.




            As a follow-up, why did these errors appear after I updated Visual Studio?




            The errors appeared because the Xamarin SDK versions in Visual Studio 2017 version 15.7 and version 15.8 have a tricky compatibility relationship with the System.Memory NuGet package versions. In Visual Studio 2017 version 15.7, Xamarin.Android and Xamarin.iOS use their own built-in implementations of the types from that NuGet package, so they don't need to reference the assembly from the NuGet package. The System.Memory NuGet package version 4.5.0 accordingly includes placeholder files for Xamarin project types to prevent conflicts.



            But the built-in implementations in the current Xamarin SDK releases do not yet cover the full surface area of the NuGet package. So for Visual Studio 2017 version 15.8, the Mono team temporarily hid those built-in implementations (by switching them to internal and removing the System.Memory facade assembly). This means that Xamarin projects now depend on the implementations from the NuGet package instead. And the System.Memory NuGet package version 4.5.1 accordingly does not include placeholder files for Xamarin project types.



            One more thing to keep in mind is that the built-in implementations in the Xamarin SDKs will cover the full surface area of the NuGet package in a future release. The built-in implementations will then be un-hidden and the placeholder files will be added back to the NuGet package. Users will need to update their NuGet packages once more when that happens. That next change will be coming in Visual Studio 2017 version 15.9 or later.






            share|improve this answer














            How do I resolve these errors?




            To resolve these errors, update the Microsoft.AspNetCore.SignalR.Client.Core NuGet package to version 1.0.1 or higher in all the projects that use it. For example:




            1. Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution > Updates.


            2. Update Microsoft.AspNetCore.SignalR.Client.Core to version 1.0.1 or higher.



            In Microsoft.AspNetCore.SignalR.Client.Core version 1.0.1, the System.Memory NuGet dependency is now (>= 4.5.1) rather than (>= 4.5.0). And because System.Memory version 4.5.1 no longer includes placeholder files for Xamarin project types, Xamarin projects will now use the .NET Standard 2.0 assembly directly from the NuGet package. This solves the errors because the Xamarin projects can now successfully locate the System.Memory reference.




            As a follow-up, why did these errors appear after I updated Visual Studio?




            The errors appeared because the Xamarin SDK versions in Visual Studio 2017 version 15.7 and version 15.8 have a tricky compatibility relationship with the System.Memory NuGet package versions. In Visual Studio 2017 version 15.7, Xamarin.Android and Xamarin.iOS use their own built-in implementations of the types from that NuGet package, so they don't need to reference the assembly from the NuGet package. The System.Memory NuGet package version 4.5.0 accordingly includes placeholder files for Xamarin project types to prevent conflicts.



            But the built-in implementations in the current Xamarin SDK releases do not yet cover the full surface area of the NuGet package. So for Visual Studio 2017 version 15.8, the Mono team temporarily hid those built-in implementations (by switching them to internal and removing the System.Memory facade assembly). This means that Xamarin projects now depend on the implementations from the NuGet package instead. And the System.Memory NuGet package version 4.5.1 accordingly does not include placeholder files for Xamarin project types.



            One more thing to keep in mind is that the built-in implementations in the Xamarin SDKs will cover the full surface area of the NuGet package in a future release. The built-in implementations will then be un-hidden and the placeholder files will be added back to the NuGet package. Users will need to update their NuGet packages once more when that happens. That next change will be coming in Visual Studio 2017 version 15.9 or later.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 12 '18 at 3:10









            Brendan ZagaeskiBrendan Zagaeski

            2,38231432




            2,38231432













            • This is terrible. I've just upgraded Visual Studio to 15.8, and now my Xamarin build is completely broken (Unfortunately, installing SignalR didn't work). Does this mean I have to wait until V 15.9 for it to work again?

              – Rob Lyndon
              Aug 14 '18 at 22:38











            • @RobLyndon, as a clarification, it sounds like your project was not using any version of SignalR before? This question + answer is in particular for projects that were already using SignalR. But the same kind of issue can occur for any NuGet package that depends on the System.Memory NuGet package. The key thing is that you will need to update the System.Memory NuGet package in all of the projects in your solution to version 4.5.1 or higher to be compatible with the Xamarin SDK versions in Visual Studio 2017 version 15.8. Do you have any versions of System.Memory lower than 4.5.1 left?

              – Brendan Zagaeski
              Aug 15 '18 at 16:35













            • I don't think so, but I'll check my bin folders.

              – Rob Lyndon
              Aug 15 '18 at 17:37






            • 1





              Ah, that's interesting. Visual Studio was adding System.Memory from the GAC, but I added a HintPath in the fsproj file, pointing it to the dll in my packages folder. Thanks for your help.

              – Rob Lyndon
              Aug 15 '18 at 17:48



















            • This is terrible. I've just upgraded Visual Studio to 15.8, and now my Xamarin build is completely broken (Unfortunately, installing SignalR didn't work). Does this mean I have to wait until V 15.9 for it to work again?

              – Rob Lyndon
              Aug 14 '18 at 22:38











            • @RobLyndon, as a clarification, it sounds like your project was not using any version of SignalR before? This question + answer is in particular for projects that were already using SignalR. But the same kind of issue can occur for any NuGet package that depends on the System.Memory NuGet package. The key thing is that you will need to update the System.Memory NuGet package in all of the projects in your solution to version 4.5.1 or higher to be compatible with the Xamarin SDK versions in Visual Studio 2017 version 15.8. Do you have any versions of System.Memory lower than 4.5.1 left?

              – Brendan Zagaeski
              Aug 15 '18 at 16:35













            • I don't think so, but I'll check my bin folders.

              – Rob Lyndon
              Aug 15 '18 at 17:37






            • 1





              Ah, that's interesting. Visual Studio was adding System.Memory from the GAC, but I added a HintPath in the fsproj file, pointing it to the dll in my packages folder. Thanks for your help.

              – Rob Lyndon
              Aug 15 '18 at 17:48

















            This is terrible. I've just upgraded Visual Studio to 15.8, and now my Xamarin build is completely broken (Unfortunately, installing SignalR didn't work). Does this mean I have to wait until V 15.9 for it to work again?

            – Rob Lyndon
            Aug 14 '18 at 22:38





            This is terrible. I've just upgraded Visual Studio to 15.8, and now my Xamarin build is completely broken (Unfortunately, installing SignalR didn't work). Does this mean I have to wait until V 15.9 for it to work again?

            – Rob Lyndon
            Aug 14 '18 at 22:38













            @RobLyndon, as a clarification, it sounds like your project was not using any version of SignalR before? This question + answer is in particular for projects that were already using SignalR. But the same kind of issue can occur for any NuGet package that depends on the System.Memory NuGet package. The key thing is that you will need to update the System.Memory NuGet package in all of the projects in your solution to version 4.5.1 or higher to be compatible with the Xamarin SDK versions in Visual Studio 2017 version 15.8. Do you have any versions of System.Memory lower than 4.5.1 left?

            – Brendan Zagaeski
            Aug 15 '18 at 16:35







            @RobLyndon, as a clarification, it sounds like your project was not using any version of SignalR before? This question + answer is in particular for projects that were already using SignalR. But the same kind of issue can occur for any NuGet package that depends on the System.Memory NuGet package. The key thing is that you will need to update the System.Memory NuGet package in all of the projects in your solution to version 4.5.1 or higher to be compatible with the Xamarin SDK versions in Visual Studio 2017 version 15.8. Do you have any versions of System.Memory lower than 4.5.1 left?

            – Brendan Zagaeski
            Aug 15 '18 at 16:35















            I don't think so, but I'll check my bin folders.

            – Rob Lyndon
            Aug 15 '18 at 17:37





            I don't think so, but I'll check my bin folders.

            – Rob Lyndon
            Aug 15 '18 at 17:37




            1




            1





            Ah, that's interesting. Visual Studio was adding System.Memory from the GAC, but I added a HintPath in the fsproj file, pointing it to the dll in my packages folder. Thanks for your help.

            – Rob Lyndon
            Aug 15 '18 at 17:48





            Ah, that's interesting. Visual Studio was adding System.Memory from the GAC, but I added a HintPath in the fsproj file, pointing it to the dll in my packages folder. Thanks for your help.

            – Rob Lyndon
            Aug 15 '18 at 17:48













            3














            I use VS Entreprise 2017 Version 15.9.1



            To solve the problem I face ( Can not resolve reference: System.Buffers, referenced by System.Memory. Please add a NuGet package or assembly reference for System.Buffers, or remove the reference to System.Memory.),
            I just install System.Buffers package by this command:



            Install-Package System.Buffers -Version 4.5.0



            https://www.nuget.org/packages/System.Buffers/






            share|improve this answer




























              3














              I use VS Entreprise 2017 Version 15.9.1



              To solve the problem I face ( Can not resolve reference: System.Buffers, referenced by System.Memory. Please add a NuGet package or assembly reference for System.Buffers, or remove the reference to System.Memory.),
              I just install System.Buffers package by this command:



              Install-Package System.Buffers -Version 4.5.0



              https://www.nuget.org/packages/System.Buffers/






              share|improve this answer


























                3












                3








                3







                I use VS Entreprise 2017 Version 15.9.1



                To solve the problem I face ( Can not resolve reference: System.Buffers, referenced by System.Memory. Please add a NuGet package or assembly reference for System.Buffers, or remove the reference to System.Memory.),
                I just install System.Buffers package by this command:



                Install-Package System.Buffers -Version 4.5.0



                https://www.nuget.org/packages/System.Buffers/






                share|improve this answer













                I use VS Entreprise 2017 Version 15.9.1



                To solve the problem I face ( Can not resolve reference: System.Buffers, referenced by System.Memory. Please add a NuGet package or assembly reference for System.Buffers, or remove the reference to System.Memory.),
                I just install System.Buffers package by this command:



                Install-Package System.Buffers -Version 4.5.0



                https://www.nuget.org/packages/System.Buffers/







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 16 '18 at 11:49









                A. BlaiseA. Blaise

                3111




                3111






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51296773%2fcan-not-resolve-reference-system-memory-or-could-not-find-system-memory%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Xamarin.iOS Cant Deploy on Iphone

                    Glorious Revolution

                    Dulmage-Mendelsohn matrix decomposition in Python