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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:35:36+00:00 2026-05-28T07:35:36+00:00

I have a Project A that references System.Web.Mvc with CopyLocal=TRue. System.Web.Mvc is in the

  • 0

I have a “Project A” that references System.Web.Mvc with CopyLocal=TRue.
System.Web.Mvc is in the GAC both on my local maching and on the buildserver.

I also have a “Project B” that references “Project A” in the output for “Project B” System.Web.Mvc is not copied to during the build.

I suspect that this is because it is in the GAC.
Is this true?
And can I do something to make MSBuild copy it to the output folder?

I read the answer from Muse VsExtensions in this thread, which talks about only the direct reference to the GAC, however we have an indirect reference through “Project A”:
.NET Reference "Copy Local" True / False Being Set Based on Contents of GAC

This blogpost is also related:
http://deeperdesign.wordpress.com/2010/02/08/msbuild-assembly-dependencies-and-the-gac/

  • 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-28T07:35:37+00:00Added an answer on May 28, 2026 at 7:35 am

    One suggestion I’ve seen floating around for this one is to change all of your projects to have the same output path. This is of limited value though, since if you have a dependency chain like:
    Prj B > Prj A > Lib C
    Then it’s probably because Prj A is shared across multiple applications, for which you will want to each have their own output path.

    I resolved the issue by instead using MSBuild to compile, and setting the OutDir property on each build.

    e.g. MSBuild projectB.csproj /p:OutDir=C:\AppBOutput\

    This will put the output for project B, its dependent projects (prj A), and prj As copy local dependencies all into the C:\AppBOutput\ directory.

    Why it Works

    When building the project in Visual Studio, both prj A and prj B have their own output directory, e.g. prjA\bin\debug and prjB\bin\debug. The GAC-stored assembly set to copylocal will be included in the output directory of the project that directly references it (prjA). But it will not be copied to the output directory of the project referencing that project (prjB). That’s just how the project reference copying works. Dig into the MSBuild targets and I’m sure the underlying reason could be found (sorry, not doing it myself).

    What the /p:OutDir=C:\AppBOutput\ MSBuild parameter does, is set the output directory of all projects to be the same. By doing this, you side-step the MSBuild behaviour of how it copies project-to-project reference outputs. Instead of relying on MSBuild to copy some of the content in prjA\bin\debug to prjB\bin\debug, you just force all projects to output to the same directory.

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

Sidebar

Related Questions

I have a project that references the System.Web.Mvc assembly in the GAC. I also
I have an ASP.NET VB.NET web project that references a VB.NET class library. I
I have an ASP.NET MVC project that works fine on my local machine (no
I have a class library project that references the version 4.1 Microsoft.Practices.Common dll. I
I have a project that uses two third party libraries, both of which make
I have a project that targets both Mac OS X 10.4 and 10.5, where
Azure web role (MVC 3 project) wont' start with Twilio controller class I have
I have one project which has RIAService with entity framework that is referenced to
I have a solution that is being referenced by a MSBuild project. In the
I have a project that is supposed to run on different (at least 2)

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.