My Visual Studio build is fine, but MSBuild (in VSTS in the cloud) fails:

Invalid TargetFSharpCoreVersion: "4.4.1.0"; should be "4.3.0.0", "4.3.1.0" or "4.4.0.0".

If I use command line MSBuild locally, this also fails.

I am using F# 4.1 (target F# runtime 4.4.1.0) with WebSharper 3.6.19.242. The issue is described here:

https://developercommunity.visualstudio.com/content/problem/37214/vsts-hosted-vs2017-build-failure-invalid-targetfsh.html

One of the replies says to edit WebSharper.targets, but of course, I don't want to do that.

Is this a problem with WebSharper 3 and F# 4.1? If so, how can I get MSBuild to work, like Visual Studio build does? I'm happy to avoid using F# 4.1 constructs within code marked as [<JavaScript>].

Thanks.