Open KirillOsenkov opened 7 years ago
cc @nguerrera @alanmcgovern
We are having this same issue with a VSIX extension project that has some template projects (which does not generate dll as outputp). Basically we have three projects with dependencies like the following.
unit test -> VSIX project -> template project
The VSIX project builds fine but the unit test project does not build because it wants a dll file from the template project.
We are getting the same issue. Project:
a.csproj -> b.csproj(Private=false) -> c.csproj
When calling publish on a.csproj
, c.csproj
is still getting published, looking at the IncludeTransitiveProjectReferences
Target it does not bubble up the Private metadata so the Publish can respect it.
Friendly ping to @rainersigwald as this issue seem pretty old. Wonder if theres some other solution we are missing here? :)
\kirillo7\public\Bugs\SDK1764 contains two .binlog files that describe the problem.
We have a project
Xamarin.Designer.Forms.Preview.csproj
that includes this project reference:We have another project,
Xamarin.VisualStudio.Forms.Previewer.csproj
which inherits that project reference transitively via theIncludeTransitiveProjectReferences
target. Bringing this reference is undesired because it causes a C# compiler conflict (the type Foo is declared in both bar.dll and XamarinFormsPreviewer.Android.dll).The bug is that the ReferenceOutputAssembly metadata is not preserved when adding that reference transitively.
We've tried different ways to turn that reference off:
Add an explicit
<ProjectReference Include="..\XamarinFormsPreviewer.Android\XamarinFormsPreviewer.Android.csproj
to the consuming project, and set the ReferenceOutputAssembly metadata to false on it. It didn't help because the target runs after evaluation and it adds another copy of the ProjectReference item which "wins" over the one we add. It could be because it uses different slashes (the one added transitively uses/
for some reason, and the one we add uses\
) but it could be a red herring and they don't unify even if slashes are identical.However it works if you turn off the entire target:
<Target Name="IncludeTransitiveProjectReference"></Target>
Good thing that Jared added this: https://github.com/dotnet/sdk/blob/8c5d7a7c5bfd3b3eba5cb5bde4339dda470bd39a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.PackageDependencyResolution.targets#L482-L483
as an escape hatch.
However it'd be good if it preserved the metadata in the first place.