Problems building a simple F# project in Xamarin Studio on Windows 8

f#, xamarin-studio

Solution

It looks like the F# project templates are using a path to an older version of F#. There is a discussion about this on the GitHub repository for the F# addin. Hopefully the project template can be updated to support different versions of F# being installed. For now you can modify your project file.

MSBuildExtensionsPath32 points to C:\Program Files (x86)\MSBuild

So you could try modifying the project template to use the following path, which should work on your machine:

<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets" />

Problem

I've had VS2013 installed on my windows 8 laptop and F# works fine. I've since installed Xamarin Studio version 4.2.2 but unfortunately can't get any F# project to build even a very simple one. I installed F# Version 3.0 from the Web Installer and have installed the F# addin in Xamarin Studio and restarted it. Compiling the simple Console Project just gives me the error: Error: Build failed. See the build log for details. With no other details anywhere. In the fsproj file There is the following: ``` <Import Project="$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets" ``` I'm not sure where the MSBuildExtensionPath32 is set or where it currently points to but if I update this to a hard-coded path that actually points at my file: ``` <Import Project="C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets" /> ``` Then when I build the project in xamarin it builds successfully. Is there an easy way of setting the MSBuildExtensionsPath32 to my actual path for xamarin? I don't really want to resort to having to set up a .bat file to launch it but can't find an option in xamarin to configure it. I feel I must be missing something. Thanks

Original source