Bug 26395 - ProjectReference resolves wrong
Summary: ProjectReference resolves wrong
Status: NEW
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-01-25 13:37 UTC by Vlad Zaitsev
Modified: 2015-01-25 13:37 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

test projects (1022 bytes, application/gzip)
2015-01-25 13:37 UTC, Vlad Zaitsev

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 26395 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Vlad Zaitsev 2015-01-25 13:37:25 UTC
Created attachment 9487 [details]
test projects

How to reproduce:
create 2 lib projects (Test2 has ProjectReference to Test)
and meta project:

<Project ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Project Include="Test.csproj" />
    <Project Include="Test2.csproj" />
  <Target Name="S1">
    <MSBuild Projects="@(Project)" Properties="OutputPath=$(OutputP); IntermediateOutputPath=$(OutputP)\obj\"/>
  <Target Name="S2">
    <MSBuild Projects="@(Project)" Properties="OutputPath=$(OutputP); IntermediateOutputPath=$(OutputP)\obj\"/>

xbuild Meta.proj /t:"S1;S2" /v:d

and see, that when building Test2 in S2, it add reference to S1/Test.dll

Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /sdk:2 /debug- /optimize+ /out:S2/obj/Test2.dll MyClass2.cs /target:library /reference:/usr/lib/mono/2.0/System.dll /reference:/ld/program/mono/Test/bug/S1//Test.dll /warn:4


Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /sdk:2 /debug- /optimize+ /out:S2/obj/Test2.dll MyClass2.cs /target:library /reference:/usr/lib/mono/2.0/System.dll /reference:/ld/program/mono/Test/bug/S2/Test.dll /warn:4

Any ideas where or how i can locate this bug?

ResolveProjectReferences have to execute "Build" target from reference csproj and add its output as a /reference:, isn't it?

So, is it problem of ResolveProjectReferences or ResolveAssemblyReference?