Skip to main content

Notifications

Announcements

No record found.

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

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

(3) ShareShare
ReportReport
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,671 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,199 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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans