Reputation: 5057
I'm trying to build 2 F# projects in one solution using MSBuild on 2 different computers.
This is what happens when I build:
Computer 1: MSBuild works.
Computer 2: MSBuild fails with the The target "Build" does not exist in
the project
error for one project and The value "" of the "Project" attribute in element <Import> is invalid. Parameter "path" cannot have zero length
for the other. Before the Xamarin misadventure, computer 2 built the solution without problems.
Building with Visual Studio works on both computers.
The problem with computer 2 might be solved by nuking the Windows install and reinstalling everything from scratch, but any solution that's less brutal would be welcome.
This question sounds a bit like the existing FSharp build fails in MSBuild, but works ok in Visual Studio question, but the .fsproj file in question already uses TargetFSharpCoreVersion
in the way the accepted answer prescribes.
Upvotes: 1
Views: 291
Reputation: 5057
It seems that just about every GitHub F# project using FAKE (F# Make) can be built from a plain-vanilla command prompt, but so far I've found one exception: my own Mpir.NET. This has to be built using either Developer Command Prompt for Visual Studio or MSBuild Command Prompt for Visual Studio.
The developer prompts set a number of environment variables. In this specific case, it was the VisualStudioVersion
variable that made the difference on computer 2 in the question. Oddly, computer 1 didn't have that variable set either, but it worked anyway. Finding out exactly why, isn't worth the trouble. Just use the MSBuild command prompt.
Upvotes: 1