Skip to content

Instantly share code, notes, and snippets.

@dtchepak
Last active December 27, 2015 13:19
Show Gist options
  • Save dtchepak/7332004 to your computer and use it in GitHub Desktop.
Save dtchepak/7332004 to your computer and use it in GitHub Desktop.
Changes to fsproj created by VS2013 in order to build F# project from the command line. (Solved, see comment)
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
- <When Condition="'$(VisualStudioVersion)' == '11.0'">
- <PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
- <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
+ <When Condition=" Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets')">
+ <PropertyGroup>
+ <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
- <PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
- <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
+ <PropertyGroup Condition=" Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
+ <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
@dtchepak
Copy link
Author

dtchepak commented Nov 7, 2013

Found the cause: command line build was using msbuild from toolsversion 4.0, not 12.0.

Related: MSBuild 12.0 info on VS Blog.

@rojepp
Copy link

rojepp commented Nov 8, 2013

@dtchepak, nice find! I haven't tried C# projects, but they probably work, so this should be an fsharpbinding bug? cc @7sharp9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment