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 12732 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
If I use the solution to build it will fail because it doesn't include any of the project references -r:X.dll.
For example, it might fail on Project.X because it depends on Project.Y and Project.Z and it doesn't have -rProject.Y or -rProject.Z in the csc (smcs) command. However, if I go into Project.X and run xbuild with the same arguments (/p:Configuration/Release /v:diag) it builds just fine.
The same solution and csproj files build in VS2010, msbuild (cmd.exe), and XS. My guess is that there is something in there that all the others are tripped up by, but xbuild can't handle.
I can build every csproj by itself and it builds just fine.
I did a git clean -fdx and git checkout . - so that I it appeared as a fresh checkout of the code.
I then built the main startup app from the csproj file and it seemed to build just fine.
This appears to only fail if I use the solution file.
As discussed on IRC, I _suspect_ that the problem is due to circular dependencies, or circular-like dependencies.
The Project.csproj contains <ProjectReference/>s. The Microsoft.Common.targets!AssignProjectConfigurations target takes @(ProjectReference) and splits into @(ProjectReferenceWithConfiguration) with the AssignProjectConfiguration task:
@(ProjectReferenceWithConfiguration) is then split into @(ProjectReferenceWithConfigurationExistent) and @(ProjectReferenceWithConfigurationNonExistent) in Microsoft.Common.targets!SplitProjectReferencesByExistent target.
@(ProjectReferenceWithConfigurationExistent) is then translated into @(ChildProjectReferences) by the Microsoft.Common.targets!ResolveProjectReferences target, by recursively using the MSBuild task.
@(ChildProjectReferences) is then translated into @(ProjectReference) in the Microsoft.Common.targets!ResolveAssemblyReferences target with the ResolveAssemblyReference task.
Finally, the Microsoft.CSharp.targets!CoreCompile target uses the Csc task to compile the code, and uses @(ReferencePath).
My (entirely untested!) suspicion is that the recursive MSBuild invocation isn't properly filling in @(ChildProjectReference), though things could be getting screwed up anywhere else.
To help narrow this down, I would suggest editing Microsoft.Common.targets and adding <Message/> elements to print out the contents of the various properties within the above mentioned targets, just to further determine what's going on.
Just a quick note, this actually fails in release mode in XS the same as with xbuild.
Going to test out jonp's comments.