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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:45:54+00:00 2026-05-29T10:45:54+00:00

I have a simple class library project (with Class1 ) and have enabled NuGet

  • 0

I have a simple class library project (with Class1) and have enabled NuGet Package Restore for the solution.

That imports the restorepackages task into the .csproj file.

I can compile the project with

C:>msbuild myproj.csproj /t:compile

And I can call the restorepackages task successfully before adding packages with

C:>msbuild myproj.csproj /t:restorepackages

However, adding any package will cause the restorepackages task to fail with an error 3.

It seems that the NuGet task is called with a wrong working directory, and you may actually fix the behavior by removing the workingdir attribut in the NuGet.targets file, that was added to the solution.

Edit the task like this:

   <Exec Command="$(RestoreCommand)"
           LogStandardErrorAsError="true"
           Condition="Exists('$(PackagesConfig)')"
           WorkingDirectory="$(NuGetToolsPath)" />

and remove the working dir:

<Exec Command="$(RestoreCommand)"
           LogStandardErrorAsError="true"
           Condition="Exists('$(PackagesConfig)')"
           />

It seems to work as expected both from commandline msbuild and within VS2010.

Does anyone know if this change might break any tooling?

  • 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-29T10:45:54+00:00Added an answer on May 29, 2026 at 10:45 am

    Can it be related to the issue “Package Restore’s $(SolutionDir) goes too far“?

    Did you check the injected SolutionDir property in your project file? It might be that the generated relative path won’t point to the actual solution dir.

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

Sidebar

Related Questions

Let's say you have a class library project that has any number of supplemental
I currently have an ASP.NET MVC 3 project, plus a class library project, that
I've created a simple solution with 2 projects. The 1st project (class library) contains
I have a simple class library (COM+ service) written in C# to consume 5
Let's say you have some 3rd-party library class that you want to extend, simply
I have a simple class that essentially just holds some values. I have overridden
I have a simple Class Hierarchy that I am trying to get to work
I have a simple class that contains some general information about the current web
I have a class library written in .Net that I would like to make
We have a large number of projects within a solution mostly simple class libraries

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.