Reputation: 5930
I'm trying to get our build server (TeamCity 8) to build an F# project (the first any of us have ever created on my team).
When I first ran the build I got the following error:
The value "" of the "Project" attribute in element <Import> is invalid. Parameter "path" cannot have zero length.
I assume that this means that the requisite F# tools are not present on the build server. I tried to rectify this using instructions on this blog post: http://www.heartysoft.com/ashic/blog/2013/3/build-fsharp-3-on-build-server-without-vs (summary: download and install VWD_FSharp.msi) but the problem persisted. I then added Condition="Exists('$(FSharpTargetsPath)')" to the Import tag in the fsproj so that it now reads:
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
which I saw in another blog post, but all that's done is swapped the earlier error for a new one:
The target "Rebuild" does not exist in the project.
Any help here would be greatly appreciated; I really don't want to install VS on the build server. The only thing about our environment that might be noteworthy is that we're on .NET 4 rather than 4.5.
Thanks
Upvotes: 5
Views: 2052
Reputation: 5930
Thanks for your question Ganesh, I have since solved the problem.
So, installing the F# tools using the link in my question did work, but after some digging round in the MSBuild directories it turns out that it only installed F# v3; my projects were targeting v3.1 (the default version in VS2013).
Going into each project's settings file and retargeting for 3.0 solved the problem.
Upvotes: 1