Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Task is deprecated. Please switch to using NuGetCommand@2's 'restore' or 'custom' option

Posted on by 162
Hi 
I had created a custom pipeline using this Link. It used to run successfully but now I am getting the error of -Task is deprecated. Please switch to using NuGetCommand@2's 'restore' or 'custom' option. Tried many things but couldn't resolve. Let me know if anyone has any idea or faced this error. 
 
  • Harshal Jain Profile Picture
    Harshal Jain 162 on at
    Task is deprecated. Please switch to using NuGetCommand@2's 'restore' or 'custom' option
    Hi Sukrut,
    I did the same but got this error - 
     
     
    I used this in cusmtom command - 
    install -Noninteractive $/XXX/Trunk/Main/BuildAutomation/packages.config -ConfigFile $/XXX/Trunk/Main/BuildAutomation/nuget.config -Verbosity Detailed -ExcludeVersion -OutputDirectory "$(NugetsPath)\$(ToolsPackage)\DevAlm"
     
    While the path of nugets and packages are this 
     
     
  • Suggested answer
    Sukrut Parab Profile Picture
    Sukrut Parab 71,647 Moderator on at
    Task is deprecated. Please switch to using NuGetCommand@2's 'restore' or 'custom' option
    Just change the task version to 2.* and in command arguments put below command  in your original pipeline. 
     
    install -NonInteractive $(NugetConfigsPath)\packages$(D365Version).config -ConfigFile $(NugetConfigsPath)\nuget.config -Verbosity Detailed -ExcludeVersion -OutputDirectory "$(NugetsPath)"
  • Harshal Jain Profile Picture
    Harshal Jain 162 on at
    Task is deprecated. Please switch to using NuGetCommand@2's 'restore' or 'custom' option
    Hi Anthony,
    Thanks for the link. I was able to import the pipeline and now got another error. I imported the pipeline from this link , but getting this error now . Please help. Not able to resolve this. 
     
  • Suggested answer
    Anthony Blake Profile Picture
    Anthony Blake 2,178 Super User 2024 Season 2 on at
    Task is deprecated. Please switch to using NuGetCommand@2's 'restore' or 'custom' option
    Hi,
     
    Microsoft's samples have been updated to use Nuget 2 - maybe create a new pipeline from the samples provided, or import a sample so you can compare the parameters side-by-side with your existing pipeline. 
     
     
     
  • Harshal Jain Profile Picture
    Harshal Jain 162 on at
    Task is deprecated. Please switch to using NuGetCommand@2's 'restore' or 'custom' option
    HI Kevin,
    So I tried the method written in the link but faced another error. Let me know if you have any solution for that - 
     
     
     
    Error - 
     
  • Suggested answer
    Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    Task is deprecated. Please switch to using NuGetCommand@2's 'restore' or 'custom' option
    Hi,
    You can refer to this official document: Deprecation announcement for NuGet Restore v1 and NuGet Installer v0 pipeline tasks | Microsoft LearnWith this update, we are announcing the upcoming deprecation of NuGet Restore v1 and NuGet Installer v0 pipeline tasks. Promptly transition to the NuGetCommand@2 pipeline task to avoid build failure starting on November 27, 2023.
    Best regards,
    Keivn

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans