@@ -24,86 +24,82 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
2424 <DefineCommonCapabilities Condition =" '$(DefineCommonCapabilities)' == ''" >true</DefineCommonCapabilities >
2525 </PropertyGroup >
2626
27- <PropertyGroup >
28- <TargetProfile Condition =" '$(TargetFrameworkIdentifier)' == '.NETFramework'" >mscorlib</TargetProfile >
29- <TargetProfile Condition =" '$(TargetFrameworkIdentifier)' != '.NETFramework'" >netcore</TargetProfile >
30- <OtherFlags >$(OtherFlags) --simpleresolution --nocopyfsharpcore</OtherFlags >
31- </PropertyGroup >
32-
3327 <ItemGroup Condition =" '$(_DebugSymbolsProduced)' == 'true' and '$(PdbFile)' != ''" >
3428 <_DebugSymbolsIntermediatePathTemporary Include =" $(PdbFile)" />
3529<!-- Add any missing .pdb extension, as the compiler does-->
3630 <_DebugSymbolsIntermediatePath Include =" @(_DebugSymbolsIntermediatePathTemporary->'%(RootDir)%(Directory)%(Filename).pdb')" />
3731 </ItemGroup >
3832
33+
34+ <!-- Import design time targets for Roslyn Project System. These are only available if Visual Studio is installed.-->
35+ <!-- Import design time targets before the common targets, which import targets from Nuget.-->
36+ <PropertyGroup >
37+ <FSharpDesignTimeTargetsPath Condition =" '$(FSharpDesignTimeTargetsPath)'==''" >$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.FSharp.DesignTime.targets</FSharpDesignTimeTargetsPath >
38+ </PropertyGroup >
39+ <Import Condition =" Exists('$(FSharpDesignTimeTargetsPath)')" Project =" $(FSharpDesignTimeTargetsPath)" />
40+
3941<!-- Locate and add mscorlib, unless NoStdLib is set-->
4042 <ItemGroup >
4143 <_ExplicitReference Include =" $(FrameworkPathOverride)\mscorlib.dll" Condition =" '$(NoStdLib)' != 'true'" />
4244 </ItemGroup >
4345
44- <!-- Import design time targets for Roslyn Project System. These are only available if Visual Studio is installed.-->
45- <!-- Import design time targets before the common targets, which import targets from Nuget.-->
4646 <PropertyGroup >
47- <FSharpDesignTimeTargetsPath Condition =" '$(FSharpDesignTimeTargetsPath)'==''" >$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.FSharp.DesignTime.targets</FSharpDesignTimeTargetsPath >
47+ <TargetProfile Condition =" '$(TargetFrameworkIdentifier)' == '.NETFramework'" >mscorlib</TargetProfile >
48+ <TargetProfile Condition =" '$(TargetFrameworkIdentifier)' != '.NETFramework'" >netcore</TargetProfile >
49+ <OtherFlags >$(OtherFlags) --simpleresolution --nocopyfsharpcore</OtherFlags >
4850 </PropertyGroup >
4951
50- <Import Condition =" Exists('$(FSharpDesignTimeTargetsPath)')" Project =" $(FSharpDesignTimeTargetsPath)" />
5152 <Import Project =" Microsoft.FSharp.targets" />
5253
5354 <PropertyGroup Condition =" '$(PackProjectInputFile)' == ''" >
5455 <PackProjectInputFile >$(MSBuildProjectFullPath)</PackProjectInputFile >
5556 </PropertyGroup >
5657
57- <!-- Always reference ValueTuple-->
58- <ItemGroup Condition =" '$(DisableValueTupleReference)' == ''" >
59- <PackageReference Include =" System.ValueTuple" Version =" 4.3.0" />
60- </ItemGroup >
61-
6258<!--
6359 Always reference FSharp.core for coreclr builds
64- FSharpCorePackageIdentity = Name of package to reference (Default = Microsoft.FSharp.Core.netcore)
65- FSharpCorePackageVersion = Version of package to reference (Default = TargetFramework = netcoreapp1.0-1.1 netstandard1.0-1.6 then '1.0.0-*')
66- (Default = TargetFramework = netcoreapp2.0 netstandard2.0 then '1.0.0-*')
60+ TargetFSharpCorePackageIdentity = Name of package to reference (Default = Microsoft.FSharp.Core.netcore)
61+ TargetFSharpCorePackageVersion = Version of package to reference (Default = TargetFramework = netcoreapp1.0-1.1 netstandard1.0-1.6 then '1.0.0-*')
62+ (Default = TargetFramework = netcoreapp2.0 netstandard2.0 then '1.0.0-*')
6763-->
68- <PropertyGroup Condition =" '$(FSharpCorePackageIdentity)' == ''" >
69- <FSharpCorePackageIdentity >Microsoft.FSharp.Core.netcore</FSharpCorePackageIdentity >
64+ <PropertyGroup Condition =" '$(TargetFSharpCorePackageVersion)' == ''" >
65+ <TargetFSharpCorePackageVersion Condition =" $(TargetFramework.StartsWith(netcoreapp1.)) or $(TargetFramework.StartsWith(netstandard1.))" >1.0.0-*</TargetFSharpCorePackageVersion >
66+ <TargetFSharpCorePackageVersion Condition =" $(TargetFramework.StartsWith(netcoreapp2.)) or $(TargetFramework.StartsWith(netstandard2.))" >1.0.0-*</TargetFSharpCorePackageVersion >
7067 </PropertyGroup >
7168
72- <PropertyGroup Condition =" '$(FSharpCorePackageVersion)' == ''" >
73- <FSharpCorePackageVersion Condition =" $(TargetFramework.StartsWith(netcoreapp1.)) or $(TargetFramework.StartsWith(netstandard1.))" >1.0.0-*</FSharpCorePackageVersion >
74- <FSharpCorePackageVersion Condition =" $(TargetFramework.StartsWith(netcoreapp2.)) or $(TargetFramework.StartsWith(netstandard2.))" >1.0.0-*</FSharpCorePackageVersion >
69+ <PropertyGroup Condition =" '$(TargetFSharpCorePackageIdentity)' == ''" >
70+ <TargetFSharpCorePackageIdentity Condition =" '$(TargetFrameworkIdentifier)' != '.NETFramework'" >Microsoft.FSharp.Core.netcore</TargetFSharpCorePackageIdentity >
7571 </PropertyGroup >
7672
77- <ItemGroup Condition =" '$(DisableAutoFSharpCoreReference)' != 'true'" >
78- <PackageReference Include =" $(FSharpCorePackageIdentity)" Version =" $(FSharpCorePackageVersion)" />
79- </ItemGroup >
73+ <PropertyGroup Condition =" '$(TargetFSharpCoreVersion)' == ''" >
74+ <!-- If TargetFSharpCoreversion and we are building for the desktop set version to the desktop version.-->
75+ <TargetFSharpCoreVersion Condition =" '$(TargetFrameworkIdentifier)' == '.NETFramework'" >4.4.1.0</TargetFSharpCoreVersion >
76+ </PropertyGroup >
77+
78+ <PropertyGroup Condition =" '$(DisableAutoValueTupleReference)' != 'true'" >
79+ <FrameworkNeedsValueTupleReference Condition =" $(TargetFramework.StartsWith(netcoreapp1.)) or $(TargetFramework.StartsWith(netstandard1.))" >true</FrameworkNeedsValueTupleReference >
80+ <FrameworkNeedsValueTupleReference Condition =" '$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net45' or '$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'net61' or '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net47'" >true</FrameworkNeedsValueTupleReference >
81+ </PropertyGroup >
8082
81- <ItemGroup Condition =" '$(DisableValueTupleReference)' != 'true'" >
82- <PackageReference Include =" System.ValueTuple" Version =" 4.3.0" />
83+ <ItemGroup Condition =" '$(TargetFramework)' != ''" >
84+ <PackageReference Include =" System.ValueTuple" Version =" 4.*" Condition =" '$(DisableAutoValueTupleReference)' != 'true' and '$(FrameworkNeedsValueTupleReference)' == 'true'" />
85+ <PackageReference Include =" $(TargetFSharpCorePackageIdentity)" Version =" $(TargetFSharpCorePackageVersion)" Condition =" '$(DisableAutoFSharpCoreReference)' != 'true'" />
8386 </ItemGroup >
8487
8588<!-- If we haven't already referenced FSharp.Core do it using the specified TargetFSharpCoreVersion.-->
86- <Target Name =" AddDefaultReferences" BeforeTargets =" Compile" AfterTargets =" ResolveReferences" >
87- <PropertyGroup >
88- <IsFSharpCoreReferenced Condition =" '%(ReferencePath.Filename)' == 'FSharp.Core'" >true</IsFSharpCoreReferenced >
89- </PropertyGroup >
90-
91- <!-- - Add it for Desktop Apps-->
92- <ItemGroup Condition =" '$(IsFSharpCoreReferenced)' != 'true' and '$(TargetName)' != 'FSharp.Core' and '$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(TargetFSharpCoreVersion)' != ''" >
93- <ReferencePath Include =" $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll" />
94- </ItemGroup >
95- </Target >
89+ <Target Condition =" '$(DisableAutoFSharpCoreReference)' != 'true' and '$(TargetFramework)' != '' and '$(TargetName)' != 'FSharp.Core' and '$(TargetFrameworkIdentifier)' == '.NETFramework'"
90+ Name =" AddDefaultReferences"
91+ BeforeTargets =" Compile"
92+ AfterTargets =" ResolveReferences" >
9693
97- <!-- If we haven't already referenced System.ValueTuple just do it.-->
98- <Target Name =" AddValueTupleReferences" BeforeTargets =" ResolveReferences" >
9994 <PropertyGroup >
100- <IsValueTupleReferenced Condition =" '%(PackageReference.Identity )' == 'System.ValueTuple '" >true</IsValueTupleReferenced >
95+ <IsFSharpCoreReferenced Condition =" '%(ReferencePath.Filename )' == 'FSharp.Core '" >true</IsFSharpCoreReferenced >
10196 </PropertyGroup >
10297
10398<!-- - Add it for Desktop Apps-->
104- <ItemGroup Condition =" '$(IsValueTupleReferenced )' != 'true'" >
105- <PackageReference Include =" System.ValueTuple " Version = " 4.3.0 " />
99+ <ItemGroup Condition =" '$(TargetFrameworkIdentifier )'== '.NETFramework' and '$(IsFSharpCoreReferenced)' != 'true'and '$(TargetFSharpCoreVersion)' != '' " >
100+ <ReferencePath Include =" $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll " />
106101 </ItemGroup >
102+
107103 </Target >
108104
109105</Project >