Azure DevOps, Restore NuGet packages for “Visual Studio Build” when using a website.sln?












0















I can't seem to find the correct settings for my devops build pipeline to enable it to restore NuGet packages so that the build process will locate them.



The first issue which I have over come is that the default settings pointed the restore at my sln file which caused it to print out:



Nothing to do. None of the projects in this solution specify any packages for NuGet to restore.


It's a 2017 website sln file and doesn't contain information about NuGet and there is no .csproj which other answers have suggested. I got round the issue by pointing it at the packages.config file. Now the restore process does locate the packages which are needed but it doesn't seem to be putting them where the "Visual Studio Build" build process can find them.



Error CS0246: The type or namespace name 'Nest' could not be found (are you missing a using directive or an assembly reference?)


I have looked in the build process section but couldn't find anything useful as the only reference is marked with:




This option is deprecated. To restore NuGet packages, add a NuGet Tool
Installer




Which is what i'm already attempting to do. I have tried moving the Destination directory of the NuGet restore to Bin and other places but it didn't make a difference.



Is there a step which i'm missing to move the files after they have been restored? or a parameter I need to pass when it's building to tell it where the package files are?



Any help or ideas would be great thanks.










share|improve this question



























    0















    I can't seem to find the correct settings for my devops build pipeline to enable it to restore NuGet packages so that the build process will locate them.



    The first issue which I have over come is that the default settings pointed the restore at my sln file which caused it to print out:



    Nothing to do. None of the projects in this solution specify any packages for NuGet to restore.


    It's a 2017 website sln file and doesn't contain information about NuGet and there is no .csproj which other answers have suggested. I got round the issue by pointing it at the packages.config file. Now the restore process does locate the packages which are needed but it doesn't seem to be putting them where the "Visual Studio Build" build process can find them.



    Error CS0246: The type or namespace name 'Nest' could not be found (are you missing a using directive or an assembly reference?)


    I have looked in the build process section but couldn't find anything useful as the only reference is marked with:




    This option is deprecated. To restore NuGet packages, add a NuGet Tool
    Installer




    Which is what i'm already attempting to do. I have tried moving the Destination directory of the NuGet restore to Bin and other places but it didn't make a difference.



    Is there a step which i'm missing to move the files after they have been restored? or a parameter I need to pass when it's building to tell it where the package files are?



    Any help or ideas would be great thanks.










    share|improve this question

























      0












      0








      0


      1






      I can't seem to find the correct settings for my devops build pipeline to enable it to restore NuGet packages so that the build process will locate them.



      The first issue which I have over come is that the default settings pointed the restore at my sln file which caused it to print out:



      Nothing to do. None of the projects in this solution specify any packages for NuGet to restore.


      It's a 2017 website sln file and doesn't contain information about NuGet and there is no .csproj which other answers have suggested. I got round the issue by pointing it at the packages.config file. Now the restore process does locate the packages which are needed but it doesn't seem to be putting them where the "Visual Studio Build" build process can find them.



      Error CS0246: The type or namespace name 'Nest' could not be found (are you missing a using directive or an assembly reference?)


      I have looked in the build process section but couldn't find anything useful as the only reference is marked with:




      This option is deprecated. To restore NuGet packages, add a NuGet Tool
      Installer




      Which is what i'm already attempting to do. I have tried moving the Destination directory of the NuGet restore to Bin and other places but it didn't make a difference.



      Is there a step which i'm missing to move the files after they have been restored? or a parameter I need to pass when it's building to tell it where the package files are?



      Any help or ideas would be great thanks.










      share|improve this question














      I can't seem to find the correct settings for my devops build pipeline to enable it to restore NuGet packages so that the build process will locate them.



      The first issue which I have over come is that the default settings pointed the restore at my sln file which caused it to print out:



      Nothing to do. None of the projects in this solution specify any packages for NuGet to restore.


      It's a 2017 website sln file and doesn't contain information about NuGet and there is no .csproj which other answers have suggested. I got round the issue by pointing it at the packages.config file. Now the restore process does locate the packages which are needed but it doesn't seem to be putting them where the "Visual Studio Build" build process can find them.



      Error CS0246: The type or namespace name 'Nest' could not be found (are you missing a using directive or an assembly reference?)


      I have looked in the build process section but couldn't find anything useful as the only reference is marked with:




      This option is deprecated. To restore NuGet packages, add a NuGet Tool
      Installer




      Which is what i'm already attempting to do. I have tried moving the Destination directory of the NuGet restore to Bin and other places but it didn't make a difference.



      Is there a step which i'm missing to move the files after they have been restored? or a parameter I need to pass when it's building to tell it where the package files are?



      Any help or ideas would be great thanks.







      nuget azure-devops nuget-package-restore






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 20 '18 at 19:46









      Ben CloseBen Close

      124311




      124311
























          1 Answer
          1






          active

          oldest

          votes


















          1















          Azure DevOps, Restore NuGet packages for “Visual Studio Build” when using a website.sln?




          You should use the NuGet Installer task during your build pipeline.



          enter image description here



          The option Restore NuGet Packages is deprecated:



          enter image description here




          This option is deprecated. To restore NuGet packages, add a NuGet
          Installer step before the build




          So to resolve this issue, please try to use NuGet Installer task, go to Package tab, add nuget restore task.



          You can specify the packages.config or the .sln file to restore packages, when you specify the packages.config, you also need provide the Destination directory, the default value is /packages:



          enter image description here



          Hope this helps.






          share|improve this answer
























          • Hi Leo thanks for answering, unfortunately I don't think you read the question fully as your answer is describing my current set up. I can't use the .sln as it doesn't know anything about packages (should it?) so i am using the packages.config file. The issue is after this point as as the build solution isn't finding the package files. How do I tell it to look in the /packages folder and moved the into the Bin folder for the website build?

            – Ben Close
            Nov 21 '18 at 10:13











          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%2f53400474%2fazure-devops-restore-nuget-packages-for-visual-studio-build-when-using-a-webs%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1















          Azure DevOps, Restore NuGet packages for “Visual Studio Build” when using a website.sln?




          You should use the NuGet Installer task during your build pipeline.



          enter image description here



          The option Restore NuGet Packages is deprecated:



          enter image description here




          This option is deprecated. To restore NuGet packages, add a NuGet
          Installer step before the build




          So to resolve this issue, please try to use NuGet Installer task, go to Package tab, add nuget restore task.



          You can specify the packages.config or the .sln file to restore packages, when you specify the packages.config, you also need provide the Destination directory, the default value is /packages:



          enter image description here



          Hope this helps.






          share|improve this answer
























          • Hi Leo thanks for answering, unfortunately I don't think you read the question fully as your answer is describing my current set up. I can't use the .sln as it doesn't know anything about packages (should it?) so i am using the packages.config file. The issue is after this point as as the build solution isn't finding the package files. How do I tell it to look in the /packages folder and moved the into the Bin folder for the website build?

            – Ben Close
            Nov 21 '18 at 10:13
















          1















          Azure DevOps, Restore NuGet packages for “Visual Studio Build” when using a website.sln?




          You should use the NuGet Installer task during your build pipeline.



          enter image description here



          The option Restore NuGet Packages is deprecated:



          enter image description here




          This option is deprecated. To restore NuGet packages, add a NuGet
          Installer step before the build




          So to resolve this issue, please try to use NuGet Installer task, go to Package tab, add nuget restore task.



          You can specify the packages.config or the .sln file to restore packages, when you specify the packages.config, you also need provide the Destination directory, the default value is /packages:



          enter image description here



          Hope this helps.






          share|improve this answer
























          • Hi Leo thanks for answering, unfortunately I don't think you read the question fully as your answer is describing my current set up. I can't use the .sln as it doesn't know anything about packages (should it?) so i am using the packages.config file. The issue is after this point as as the build solution isn't finding the package files. How do I tell it to look in the /packages folder and moved the into the Bin folder for the website build?

            – Ben Close
            Nov 21 '18 at 10:13














          1












          1








          1








          Azure DevOps, Restore NuGet packages for “Visual Studio Build” when using a website.sln?




          You should use the NuGet Installer task during your build pipeline.



          enter image description here



          The option Restore NuGet Packages is deprecated:



          enter image description here




          This option is deprecated. To restore NuGet packages, add a NuGet
          Installer step before the build




          So to resolve this issue, please try to use NuGet Installer task, go to Package tab, add nuget restore task.



          You can specify the packages.config or the .sln file to restore packages, when you specify the packages.config, you also need provide the Destination directory, the default value is /packages:



          enter image description here



          Hope this helps.






          share|improve this answer














          Azure DevOps, Restore NuGet packages for “Visual Studio Build” when using a website.sln?




          You should use the NuGet Installer task during your build pipeline.



          enter image description here



          The option Restore NuGet Packages is deprecated:



          enter image description here




          This option is deprecated. To restore NuGet packages, add a NuGet
          Installer step before the build




          So to resolve this issue, please try to use NuGet Installer task, go to Package tab, add nuget restore task.



          You can specify the packages.config or the .sln file to restore packages, when you specify the packages.config, you also need provide the Destination directory, the default value is /packages:



          enter image description here



          Hope this helps.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 '18 at 3:14









          Leo Liu-MSFTLeo Liu-MSFT

          20.4k22634




          20.4k22634













          • Hi Leo thanks for answering, unfortunately I don't think you read the question fully as your answer is describing my current set up. I can't use the .sln as it doesn't know anything about packages (should it?) so i am using the packages.config file. The issue is after this point as as the build solution isn't finding the package files. How do I tell it to look in the /packages folder and moved the into the Bin folder for the website build?

            – Ben Close
            Nov 21 '18 at 10:13



















          • Hi Leo thanks for answering, unfortunately I don't think you read the question fully as your answer is describing my current set up. I can't use the .sln as it doesn't know anything about packages (should it?) so i am using the packages.config file. The issue is after this point as as the build solution isn't finding the package files. How do I tell it to look in the /packages folder and moved the into the Bin folder for the website build?

            – Ben Close
            Nov 21 '18 at 10:13

















          Hi Leo thanks for answering, unfortunately I don't think you read the question fully as your answer is describing my current set up. I can't use the .sln as it doesn't know anything about packages (should it?) so i am using the packages.config file. The issue is after this point as as the build solution isn't finding the package files. How do I tell it to look in the /packages folder and moved the into the Bin folder for the website build?

          – Ben Close
          Nov 21 '18 at 10:13





          Hi Leo thanks for answering, unfortunately I don't think you read the question fully as your answer is describing my current set up. I can't use the .sln as it doesn't know anything about packages (should it?) so i am using the packages.config file. The issue is after this point as as the build solution isn't finding the package files. How do I tell it to look in the /packages folder and moved the into the Bin folder for the website build?

          – Ben Close
          Nov 21 '18 at 10:13




















          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%2f53400474%2fazure-devops-restore-nuget-packages-for-visual-studio-build-when-using-a-webs%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

          Guess what letter conforming each word

          Port of Spain

          Run scheduled task as local user group (not BUILTIN)