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 7017569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:55:52+00:00 2026-05-27T22:55:52+00:00

I added the recent nuget package restore feature to a solution using ‘Enable NuGet

  • 0

I added the recent nuget package restore feature to a solution using ‘Enable NuGet Package Restore’:
http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages

However it broke my build server and I didn’t have the time to fix it, so I wanted to remove it. There’s no option for that as far as I know, so I removed the following line manually from all my *.csproj files:

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

The problem now is that every time my *.csproj files are checked out or open my solution, the line is automatically added again, breaking my build if I accidentally check it in 🙁

Any ideas how I can remove it permanently?

UPDATE: despite the answer below it still keeps coming back when opening the solution, anyone with the same problem?

  • 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-27T22:55:52+00:00Added an answer on May 27, 2026 at 10:55 pm

    I didn’t look very well, there’s another property added to the project files:

    <RestorePackages>true</RestorePackages>
    

    Just have to remove this as well as all these lines manually from all *.csproj files:

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

    UPDATE:

    Turns out it’s a persistent little bugger, if you’re manually editing your project files, make sure to close the solution and delete all the lines from the project at once, otherwise they’re just added again once the project reloads…

    UPDATE2:

    Delete the .nuget folder from the solution root too

    UPDATE3:

    A later version of NuGet adds another section that you need to remove:

     <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
        <PropertyGroup>
          <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
        </PropertyGroup>
        <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
      </Target>
    

    Update4

    Inside the NuGet.Targets located in the .nuget folder, there is another section that gets added to new projects… switch it to false.

    <!-- We need to ensure packages are restored prior to assembly resolve -->
    <BuildDependsOn Condition="$(RestorePackages) == 'false'">
        RestorePackages;
        $(BuildDependsOn);
    </BuildDependsOn>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ADDED: This question is now, I believe, subsumed by this one: Using GNU Screen
I added a text file to a testapp's solution and I want to read
I added the following code to my .vimrc: save and restore folds when a
I need a way of grabbing the most recent item added to a ReplaySubject
I use Code::Blocks with Boost::Jam. A recent update to C::B added some new custom
I am trying to show the 8 most recent scans added by doing this:
I'm using django-basic-apps' blog app, but I have a few modification to it: added
Background I written an R package, and now a collaborator (recent CS grad who
I recent added source file parsing to an existing tool that generated output files
In recent updates to PHP, they added in various interfaces to allow an object

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.