Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One F# 4.1 compiler includes targetPlatform value of netstandard, the other does not

Tags:

f#

The F# 4.1 compiler on my build machine has slightly different --targetProfile options than the F# 4.1 compiler on my dev machine.

On my dev machine, when I type fsc.exe -? the output includes the following:

Microsoft (R) F# Compiler version 4.1
     :
--targetprofile:<string>
Specify target framework profile of this assembly.
Valid values are mscorlib, netcore or netstandard.
     :

On my build server, the same command outputs the following:

Microsoft (R) F# Compiler version 4.1
     :
--targetprofile:<string>
Specify target framework profile of this assembly.
Valid values are mscorlib or netcore.
     :

Notice that the dev machine includes netstandard as a valid value, but the build server does not.

Consequently, when I try to build my project on the build server, I get a compile time error of "error FS1052: Invalid value 'netstandard' for '--targetprofile'"

What is going on? Is there a way to display the real version number of an F# 4.1 compiler? fsc.exe --version does not work.

like image 726
Wallace Kelly Avatar asked Oct 30 '22 01:10

Wallace Kelly


1 Answers

I don't think this is to do with the F# compiler version but rather the .NET SDK(s) installed. Check the target framework TFMs.

I have mscorlib, netcore or netstandard and I will take a stab at where they come from:

  • mscorlib from full framework...comes with Windows
  • netcore installed with VS 2017 when selecting ".NET desktop development"
  • netstandard installed with NET Core SDK

If this is the case I would imagine installing .NET Core SDK on the build server would sort it out since you seem to be targeting netstandard.

like image 150
Devon Burriss Avatar answered Jan 02 '23 20:01

Devon Burriss