Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 33082 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
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
We are trying to switch to using xbuild and are running into problems with project references that contain conditional Content/None elements. Simple repro:
Project A has a project reference to Project C
Project C has a conditional Content element (on the item, ItemGroup, or in a Choose doesn't matter), let's say ProjectC.dll.config
When building with xbuild, the .config file will be copied to the build output for ProjectC, but will not be copied to the build output of ProjectA.
This behavior is the same on 3.4, 4.2-pre and master, although building with Xamarin Studio using the MSBuild engine option builds as expected. On a side note, the "minimal" verbosity for xbuild is not very useful as it doesn't output anything (not even the project name) except the configuration and platform whereas Xamarin Studio outputs the project also.
Created attachment 12497 [details]
Sample solution with two projects to demonstrate the problem.
When copying ProjectC to ProjectA's build output folder, It actually looks like the condition is being evaluated based on the Platform/Configuration properties passed in on the command-line instead of the solution's settings for that project. This can result in incorrect items being copied to the build output of ProjectA.
For example, in the attached solution, ProjectC is set to build Release|MacOSX when building the solution in Release|x86. If you change the condition on the in ProjectC to be '$(Platform)' == 'x86', ProjectC.dll.config with correctly not be copied to ProjectC's build output, but will incorrectly be copied to ProjectA's build output.
This seems to be a problem with the use of `Condition` in several places.
When trying to use a Condition with `ProjectReference` or `ItemGroup` isn't evaluated at all and will simply include the reference regardless.
Created attachment 13131 [details]
Project Reference Failure Solution
Attached is an example solution of Condition failure with Project references