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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:29:15+00:00 2026-06-12T09:29:15+00:00

I try to build .csproj that references some projects in solution. These references are

  • 0

I try to build .csproj that references some projects in solution. These references are marked with CopyLocal=False. And this is the desired behavior.

I build it for CI using MSBuild, so I set output folder via /p:OutputPath="some output dir". I also set /p:SolutionDir="path to the solution" to correctly resolve some NuGet references.

The problem is: when I specify OutputPath with absolute path to the output directory (like d:\solution\build\buildgroupsubfolder), then MSBuild copies every dependency into output directory, I don’t know why it is doing so. And if I specify output path with relative path (like ..\..\..\..\..\build\buildgroupsubfolder) then MSBuild correctly handles CopyLocal=false and doesn’t copy references to output directory.

We had some nesting in our solution, projects are divided into groups, so we want them to be build into sub folders. And I want to be able to specify build path relative to base build path and not to path of project itself.

Why does MSBuild ignore CopyLocal=false when absolute path is specified and treats it correctly when relative path is specified?

  • 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-12T09:29:15+00:00Added an answer on June 12, 2026 at 9:29 am

    Well, I’ve digged further. I’ve found out that MSBuild misbehaves, but not where I’ve though about it.

    I’ve thought MSBuild had incorrect behavior as I described in my question. It really process CopyLocal=false as it should if I set OutputDir to relative path. And it misbehaves if I set OutputDir to absolute path. I found the answer in MSDN that says:

    OutputPath – Specifies the path to the output directory, relative to
    the project directory
    , for example, “bin\Debug”.

    So in fact MSBuild should warn me or even fail when I set OutputPath to absolute path, but it doesn’t. That’s why I was under impression that absolute path is OK and there’s a bug with CopyLocal handling. The actual bug is that MSBuild works when it should fail.

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

Sidebar

Related Questions

When I rename a project within a solution, and then try and build that
I try build a php regex that validate this type of input string: {name:'something
i try to build a app that is in landsscape mode all the time.
Im try to build my plugins that sit in a seperate directory on the
When I try to build a project in Visual Studio 2005 that has a
I try to build some application using hibernate for persistence (my first one). The
I try to build simple Java EE application that uses JPA + EJB3 and
i try to build a menu and i need some help to make it
I have recently upgraded my .Net 3.5 solution containing some C# code projects and
I get compilation error when try to build: d:\Co\RnD\Server\WebSites\Writers\Dev-Accounts-3.10\Accounts\BrandToolbar.Account\BrandToolbar.Account.csproj(3682, 5): error MSB4062: The "BrandToolbar.Web.Compression.MSBuild.CodeFilesTask"

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.