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 on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Mono 4.4 (Cycle 7) is able to build Java.Interop:
Mono 4.6 (Cycle 8) is *not* able to build Java.Interop. It fails when trying to build Mono.Linq.Expressions:
> error : The TargetFrameworkProfile property is not set for project 'Mono.Linq.Expressions.csproj'.
> Portable projects must specify a profile.
This is lunacy, as the project *does* define that property:
Furthermore, `msbuild` also fails to build the project, with the same error.
Finally, if we "force" the property to be set by providing it on the command-line:
> $ msbuild /p:TargetFrameworkProfile=Profile92
It fails with incomprehensible errors:
In particular, why is it referencing files from the GAC?!
> /Library/Frameworks/Mono.framework/Versions/4.6.0/lib/mono/4.5/mcs.exe /noconfig
> /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva-
The project file Mono.Linq.Expressions.csproj actually *unsets* `TargetFrameworkProfile`:
The `TargetFrameworkProfile` check is done in a target called `_CheckForInvalidTargetFrameworkProfile` which comes from `Microsoft.Portable.Core.targets`. This target depends on a target named `_CheckForInvalidConfigurationAndPlatform` to be present, in `Microsoft.Common.targets`. In 4.4.x, there was no target with that name (we had a target that did the same job, but with a different name). As a result the `TargetFrameworkProfile` check from portable targets wouldn’t run at all. But in 4.6.x, we fixed the naming and as a result that target runs now and it errors out because of the missing `$(TargetFrameworkProfile)` property.
So, the project with stable mono (4.4.x) in absence of `$(TargetFrameworkProfile)` got compiled with `/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/xbuild-frameworks/.NETPortable/v4.0/*.dll` instead of `Profile92`. And removing the "unset-TargetFrameworkProfile" from the csproj fixes this issue for both xbuild and msbuild.
- I have opened a PR upstream for this - https://github.com/jbevain/mono.linq.expressions/pull/14 .
- This is not a bug in xbuild/msbuild