Reference primary dependent target only and do not execute custom targets in dependent csproj #7525
Unanswered
pavan-kumar-dev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Taking an example of project dependency
A -> B -> C
Assume the target dir of B has B.dll, C.dll, ifx.dll, xmls, perfcounters etc.
If I have A referencing B via project reference, with the following msbuild properties (buildProjectReferences=false), I see all the source items from B's target directory and C.dll being copied to target directory of Project A.
Is there a way to tell project reference to just refer and copy primary output of the dependent (in this case B.dll only)? I'm looking for MSBuild property that can be passed within project reference tag and not to msbuild cmd so that it won't affect all project references.
Secondly, is there a way to avoid custom target execution in dependent csproj file? In this case, if B.csproj has copy tasks or any other custom targets, they get executed due to project reference. how can we avoid them since our expectation is that targets of B.csproj will be available and need to build it along with any custom targets inside it?
Beta Was this translation helpful? Give feedback.
All reactions