Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7616367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:52:12+00:00 2026-05-31T02:52:12+00:00

I enabled the Restore Package option in my solution so when I upload the

  • 0

I enabled the Restore Package option in my solution so when I upload the code to the CI server it updates all the packages that it needs to build correctly, and it works great. Now the problem is that on my local machine, the build takes a long time to start because is “updating the packages”. Is there a way to enable the Restore Package in release build only?

I’ve tried to move the <RestorePackage> property in the .csproj files to the release/debug sections with false and true, but NuGet updates the attribute when a open the NuGet console and resets both to true; also tried to only include the property in the release section, but then NuGet adds it to the global section… so I had no luck making it stay the way I want it…

Any advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:52:13+00:00Added an answer on May 31, 2026 at 2:52 am

    You have probably managed to answer this by now but if not then these are the steps you need to follow

    Right where your solution file is within Windows there should be a folder named .nuget. Either rename or delete this folder.

    Now open each .csproj or .vbproj file in notepad or any text editor and remove these lines

    <RestorePackages>true</RestorePackages>
    <Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
    

    The important part is removing/renaming the .nuget folder. This should now disable package restore completely.

    Edit: To selectively disable package restore for DEBUG builds edit the Nuget.settings.targets file and modify the following line

    <RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>
    

    To

    <RestorePackages Condition="$(RestorePackages) == '' AND '$(Configuration)' == 'Debug'">false</RestorePackages>
    

    The Nuget.settings.targets file is under the .nuget folder which should be in the same folder as your solution file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added the recent nuget package restore feature to a solution using 'Enable NuGet
Can a LINQ enabled app run on a machine that only has the .NET
Can a Silverlight 2 enabled web page be managed from an Apache server? (I'm
I have enabled the Web Server on my Mac OS X (10.5.6) by going
I ran a data copy function in Toad that disabled all constraints and then
I've got an app that needs to disable infrastructure access and then re-enable it
Given a gem that defines top-level classes that clash with some code I have
I enabled IntelliTrace on an ASP.NET MVC2 app that seems to working very well
NuGet Package Restore seems to be the correct way to combine NuGet with source-control
Is output buffering enabled by default in Python's interpreter for sys.stdout ? If the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.