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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:19:05+00:00 2026-06-17T13:19:05+00:00

I recently started using NuGet to manage external packages. For now I have only

  • 0

I recently started using NuGet to manage external packages. For now I have only needed it for NLog.
Everything works fine when I Build the project in VS 2012. However, I am trying out TeamCity as a CI server (I’m fairly new to CI) and it is giving me the following error:

[Csc] SomeNamespace\SomeClass.cs(10, 7): error CS0246: 
The type or namespace name 'NLog' could not be found 
(are you missing a using directive or an assembly reference?)

(this error is repeated throughout where ever I use NLog)

Now I did not include the ‘packages/’ folder in SVN, since I thought it was good practice not to include binaries and let MSBuild in TeamCity download these on its own. However it’s clearly not doing that. I DO include the ‘packages.xml’ file in SVN.
What can I check to see what is going wrong?

Update
Thanks to @DavidBrabant I was nudged in the right direction. However, I now get the following error in TeamCity:

Package restore is disabled by default. To give consent, open the Visual Studio Options dialog, 
click on Package Manager node and check 'Allow NuGet to download missing packages during build.'

However I’m not in Visual Studio but TeamCity, so I do not know how to set ‘consent’ to true! I tried to set RestorePackages to ‘true’ in the NuGet.targets file:

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

but this didn’t work.

Update 2
To make it work I also set the following property NuGet.targets:

<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'true' ">false</RequireRestoreConsent>

This made the build run succesfully!

  • 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-06-17T13:19:06+00:00Added an answer on June 17, 2026 at 1:19 pm

    The enable package restore feature built into NuGet allows you to very easily set up the pre-build part of the workflow. To do so, right-click the solution node in Visual Studio’s Solution Explorer, and click the Enable NuGet Package Restore option. Note that you need to have the NuGet Visual Studio Extension installed on your system. If you do, and you still don’t see this menu item appear, you either already enabled this option, or you have a folder named .nuget in your solution directory.

    After having set that option, you can now delete all sub-folders of your package installation directory, by default $(SolutionDir)\packages, except for the repositories.config file, and your solution should still compile properly. During compilation, you should see NuGet installation traces in the Visual Studio output window, and you should see the required NuGet packages reappear in the package installation directory as well.

    Also see Using Nuget without committing packages.

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

Sidebar

Related Questions

I have recently started using boost::exception. Now I would like to use boost::errinfo_nested_exception to
I've recently started using a private NuGet server to manage my organization's internal libraries.
We recently started using AnkhSVN subversion plugin for Visual Studio. Everything is working as
I recently started using NERDTree with vim, and have set it to automatically open
I recently started using WPF and the MVVM framework, one thing that I have
I recently started using Eclipse IDE and have read at a number of places
I have recently started using a shared-host for my clients so see project progress
Ive recently started using Ruby on Rails for a project of mine and have
I've just recently started using VS2008 for a new tools project, and have been
I have recently started using Google Webmaster Tools . I was quite surprised to

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.