Questions tagged [msbuild-projectreference]

17 questions
62
votes
1 answer

MSBuild ProjectReference:private ("Copy Local") - what are the allowed values and behaviour?

TL;DR Is there any official documentation that describes in detail how the / "Copy Local" option works with MSBuild? And what values are supposed to go into it? When you add a project reference from one project in Visual Studio to…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
16
votes
2 answers

Conditional reference in Visual Studio Community 2017

I am creating a multi-platform application. I have a multi-targeted shared library (targeting .netstandard 2.0 and .net 4.5)...See project file: netstandard2.0;net45 When…
15
votes
3 answers

Assembly in GAC is not copied to output in project that references a project that references the GAC assembly with CopyLocal=true

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…
khebbie
  • 2,490
  • 3
  • 31
  • 53
14
votes
1 answer

WiX properties RefProjectOutputGroups RefTargetDir

When referencing projects within WiX projects (*.wixproj) I often saw the code snippet Foo.Bar {0bd367ce-5072-4161-8447-ff4deed97bd4}
Aeon512
  • 175
  • 1
  • 8
10
votes
2 answers

Configuration for ProjectReference in MSBuild

Is it possible to set the configuration of ProjectReference in MSBuild? Scenario: I have a build script (web deploy) that has a number of configurations where the only difference has to do with how they are deployed and not the build it self. I…
Rune FS
  • 21,497
  • 7
  • 62
  • 96
5
votes
1 answer

MSBuild - race condition while trying to build project references

I'm facing a weird issue while trying to build using MSBuild. I'm using MSBuild to build a solution file with /m (parallel build) and BuildProjectReferences set to true. Suppose I have A.vcxproj and B.vcxproj in the .sln file with B having a project…
4
votes
1 answer

Transient dependencies of .NET Standard 2.0 dll are missing in bin when referenced by .NET 462 project

If a .NET 462 project references a .NET Standard 2.0 dll the dependencies are not copied to the output bin folder. It works correctly when the .NET Standard 2.0 project is referenced as and…
bobschi
  • 325
  • 1
  • 3
  • 13
4
votes
1 answer

What gets precedence during build? nuget reference or project reference

I have a .net solution that has two class library projects (Say A and B) that I am also publishing to a nuget server. If I were to add A as a project reference as well as a nuget reference on B, what version of the A.dll should I expect in the bin…
KnightFox
  • 3,132
  • 4
  • 20
  • 35
2
votes
0 answers

Enabling transitive project references in .Net Framework => .Net Standard project

I've got a project setup as follows: Project B has a dependency on Project A Project C has a dependency on Project B I would like Project C to have access to Project A's types transitively. However, in my Project C (.Net Framework 4.8) referencing…
2
votes
1 answer

Include additional files in build using MSBuild ProjectReference?

I have a class library that has several files that it depends on, and those files must be packaged up for deployment with any project that depends on this library. Right now this means that I must customize each one of those dependent projects to…
bwerks
  • 8,651
  • 14
  • 68
  • 100
2
votes
1 answer

How do I reference a .NET 4.5.2 library from the .NET Core project (VS2017)

I have a .NET Core Class Library created in VS2017. I need to reference an assembly build against .NET 4.5.2. When I add the reference, I receive the following error: Error CS0012 The type 'Object' is defined in an assembly that is…
2
votes
0 answers

Copy files in addition to project primary output using MSBuild project references?

I have a project that is referenced by many dependent projects, and some files in that project that must be in the binary directory of the dependent projects for the dependent projects to run. Currently, I have several custom AfterBuild targets…
bwerks
  • 8,651
  • 14
  • 68
  • 100
1
vote
2 answers

VS 2010 build issue : reference issue

I have solution with multiple projects. Few common folders for Bin/Lib/Include e.g. all exported lib in Lib folder, executable in Bin folder and header in Include Example Solution - S Project A1 - DLL Project A2 - Exe ... Project An Project A2 is…
Ashish Kasma
  • 3,594
  • 7
  • 26
  • 29
1
vote
0 answers

Sharing violation when multiple projects reference library in msbuild

I have run into a problem with msbuild. I have a three tiers of project files. The lowest create libraries, some of which are language neutral, and some of which are language specific. The next tier builds a project that combines the language…
0
votes
1 answer

Project dependencies in a nuget package are being copied to the application bin folder despite being marked PrivateAssets

I have .netcore2.0 app called MyHelper. MyHelper is referencing a .netstandard2.0 project called B. MyHelper is published as a nuget package. I need to use MyHelper in other projects and solutions only at build time, therefore in my other projects I…
1
2