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.
F# 3.0 projects files had an import like this:
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" Condition=" Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')" />
but F# 3.1 project files have this instead:
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
This is failing because $(FSharpTargetsPath) is not correctly replaced in the Import Project tag.
So the targets depend on the VisualStudioVersion property having a value?
If VisualStudioVersion doesn't have a value, the condition turns to '' == '11.0' so the Otherwise case is the valid one. So I was expecting FSharpTargetsPath to be set to $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets, but it's set to "" and InvalidProjectFileException is thrown in mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngineImport.cs, line 221
This applies to a project upgraded from VS2012 to VS2013. For a F# project created directly in VS2013, there's more stuff that needs to be fixed :(
*>= in Conditions
VS2013 also includes a new ImportGroup tag that groups several Imports under a condition
I've submitted a pull request with a fix: https://github.com/mono/mono/pull/767
The pull request for this has been merged and according to @kumpera will be released in 3.2.5