2

I've found solution to get C# / F# on travis: How do I use Travis-CI with C# or F#

except I get 3.2.4 version

I checked archive and found fsharpc there but can't find Microsoft.FSharp.Targets or something alike...

So... my Visual Studio F# project contains:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v12.0\FSharp\Microsoft.FSharp.Targets" />

And sure it will not work there... I was trying several ways including downloading Microsoft.FSharp.Targets from F# opensource github but then it was trying to use fsc instead fsharpc, that was a bit strange for me...

So in nutshell how should I make my fsproj file to be look like to make it work on MonoFramework provided by Xamarin ?

Community
  • 1
  • 1
cnd
  • 32,616
  • 62
  • 183
  • 313
  • What are you trying to do in xamarin? Also, have you installed the language bindings for F#? – N_A Nov 14 '13 at 05:18
  • @mydogisbox all I have is from here: http://download.mono-project.com/archive/${MONO_VER}/macos-10-x86/MonoFramework-MDK-${MONO_VER}.macos10.xamarin.x86.dmg where version is 3.2.4 – cnd Nov 14 '13 at 06:03
  • There are details on setting up monodevelop with F# support here: http://fsharp.org/use/mac/ It doesn't sound like you've installed the F# plugin. – N_A Nov 14 '13 at 16:38
  • there is no mono-develop and I hope that I don't need it to build F# project. – cnd Nov 15 '13 at 04:40
  • Ah, sorry. Monodevelop is basically the same thing as Xamarin Studio. The plugin idea still applies. – N_A Nov 15 '13 at 04:51
  • @mydogisbox I don't use monodevelp or Xamarin Studio or even any graphical environment there. – cnd Nov 15 '13 at 04:56
  • Ah, now I follow. Sorry, a bit slow. Looks like this is a dup of http://stackoverflow.com/questions/15856141/build-an-f-project-file-on-os-x-from-the-terminal – N_A Nov 15 '13 at 05:05

1 Answers1

3

I don't use Visual Studio 2013 myself, but have helped another OSS project who did, get running on mono.

The current VS2013 fsproj has a conditional import for VS2012 (v11) for fsharp targets.

  <PropertyGroup>
    <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
  </PropertyGroup>
  <PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'">
    <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
  </PropertyGroup>

by adding an Or $(OS) != 'Windows_NT' this will work with xbuild of mono 3.2.4.

  <PropertyGroup>
    <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
  </PropertyGroup>
  <PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0' Or $(OS) != 'Windows_NT'">
    <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
  </PropertyGroup>
jbtule
  • 31,383
  • 12
  • 95
  • 128