John Reynolds
John Reynolds

Reputation: 5057

F# build works in Visual Studio, but fails or succeeds in MSBuild depending on computer

I'm trying to build 2 F# projects in one solution using MSBuild on 2 different computers.

This is what happens when I build:

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

Answers (1)

John Reynolds
John Reynolds

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

Related Questions