diff --git a/eng/Versions.props b/eng/Versions.props
index 334e324e6f65d0dc61bd80f781b92c63a6459c6d..971e0bc40493961c1e271f38b7d994fe676d841d 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -31,7 +31,7 @@
6.0.0.0
- 42
+ 437200$(FSRevisionVersion)
diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt
index 53cfa34166786f7f67b2b17843e83ce473e87dac..2fca7afeb605803e808bfa9cd94d42ec59ec99d5 100644
--- a/src/Compiler/FSComp.txt
+++ b/src/Compiler/FSComp.txt
@@ -962,10 +962,6 @@ typeInfoFromFirst,"from %s"
typeInfoFromNext,"also from %s"
typeInfoGeneratedProperty,"generated property"
typeInfoGeneratedType,"generated type"
-assemblyResolutionFoundByAssemblyFoldersKey,"Found by AssemblyFolders registry key"
-assemblyResolutionFoundByAssemblyFoldersExKey,"Found by AssemblyFoldersEx registry key"
-assemblyResolutionNetFramework,".NET Framework"
-assemblyResolutionGAC,"Global Assembly Cache"
1089,recursiveClassHierarchy,"Recursive class hierarchy in type '%s'"
1090,InvalidRecursiveReferenceToAbstractSlot,"Invalid recursive reference to an abstract slot"
1091,eventHasNonStandardType,"The event '%s' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit %s and %s methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'."
diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj
index e7468b340866fb405ef97bc741beaa2d4f42f158..eedb771f0f3f4a526dde3ac6543af2954c075a32 100644
--- a/src/Compiler/FSharp.Compiler.Service.fsproj
+++ b/src/Compiler/FSharp.Compiler.Service.fsproj
@@ -461,8 +461,6 @@
-
-
@@ -492,9 +490,6 @@
-
-
-
diff --git a/src/Compiler/FSharp.Compiler.Service.nuspec b/src/Compiler/FSharp.Compiler.Service.nuspec
index c7b55ebb61317b88152bbc9da24b1ee8cb513ecb..a60bdb810218686e3a8734a3da471bede3fbb759 100644
--- a/src/Compiler/FSharp.Compiler.Service.nuspec
+++ b/src/Compiler/FSharp.Compiler.Service.nuspec
@@ -6,9 +6,6 @@
-
-
-
diff --git a/src/Compiler/Facilities/ReferenceResolver.fs b/src/Compiler/Facilities/ReferenceResolver.fs
index d4eeb29871dfccfeeb2f0b04dd1620b988185272..7e825741942538c82e0d3a3a437f176224f8a9ce 100644
--- a/src/Compiler/Facilities/ReferenceResolver.fs
+++ b/src/Compiler/Facilities/ReferenceResolver.fs
@@ -2,7 +2,7 @@
namespace FSharp.Compiler.CodeAnalysis
-exception internal LegacyResolutionFailure
+exception LegacyResolutionFailure
[]
type LegacyResolutionEnvironment =
@@ -28,7 +28,7 @@ type LegacyResolvedFile =
sprintf "LegacyResolvedFile(%s)" this.itemSpec
[]
-type internal ILegacyReferenceResolver =
+type ILegacyReferenceResolver =
/// Get the "v4.5.1"-style moniker for the highest installed .NET Framework version.
/// This is the value passed back to Resolve if no explicit "mscorlib" has been given.
///
diff --git a/src/Compiler/Facilities/ReferenceResolver.fsi b/src/Compiler/Facilities/ReferenceResolver.fsi
index 619c21d423c81ba4dbf25c04433c31b66353ee5c..8371775f956373105bda16953dcb8b1dcde95551 100644
--- a/src/Compiler/Facilities/ReferenceResolver.fsi
+++ b/src/Compiler/Facilities/ReferenceResolver.fsi
@@ -4,17 +4,17 @@ namespace FSharp.Compiler.CodeAnalysis
open System
-exception internal LegacyResolutionFailure
+exception LegacyResolutionFailure
[]
-type internal LegacyResolutionEnvironment =
+type LegacyResolutionEnvironment =
/// Indicates a script or source being edited or compiled. Uses reference assemblies (not implementation assemblies).
| EditingOrCompilation of isEditing: bool
/// Indicates a script or source being dynamically compiled and executed. Uses implementation assemblies.
| CompilationAndEvaluation
-type internal LegacyResolvedFile =
+type LegacyResolvedFile =
{
/// Item specification.
itemSpec: string
@@ -27,7 +27,7 @@ type internal LegacyResolvedFile =
}
[]
-type internal ILegacyReferenceResolver =
+type ILegacyReferenceResolver =
/// Get the "v4.5.1"-style moniker for the highest installed .NET Framework version.
/// This is the value passed back to Resolve if no explicit "mscorlib" has been given.
///
@@ -59,5 +59,5 @@ type internal ILegacyReferenceResolver =
// outside FSharp.Compiler.Service
[]
type LegacyReferenceResolver =
- internal new: impl: ILegacyReferenceResolver -> LegacyReferenceResolver
+ new: impl: ILegacyReferenceResolver -> LegacyReferenceResolver
member internal Impl: ILegacyReferenceResolver
diff --git a/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs b/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs
index 21d3260c5c85aa4c33e1981246fd0f97f23f1835..b3492cb81aca0c516a11839e428b5a390240904e 100644
--- a/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs
+++ b/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs
@@ -2,340 +2,318 @@
module internal FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver
-open System
-open System.IO
-open System.Reflection
-open Microsoft.Build.Utilities
-open Internal.Utilities.Library
-open FSharp.Compiler.IO
-
-// ATTENTION!: the following code needs to be updated every time we are switching to the new MSBuild version because new .NET framework version was released
-// 1. List of frameworks
-// 2. DeriveTargetFrameworkDirectoriesFor45Plus
-// 3. HighestInstalledRefAssembliesOrDotNETFramework
-// 4. GetPathToDotNetFrameworkImlpementationAssemblies
-[]
-let private Net45 = "v4.5"
-
-[]
-let private Net451 = "v4.5.1"
-
-[]
-let private Net452 = "v4.5.2" // not available in Dev15 MSBuild version
-
-[]
-let private Net46 = "v4.6"
-
-[]
-let private Net461 = "v4.6.1"
-
-[]
-let private Net462 = "v4.6.2"
-
-[]
-let private Net47 = "v4.7"
-
-[]
-let private Net471 = "v4.7.1"
-
-[]
-let private Net472 = "v4.7.2"
-
-[]
-let private Net48 = "v4.8"
-
-let SupportedDesktopFrameworkVersions =
- [ Net48; Net472; Net471; Net47; Net462; Net461; Net46; Net452; Net451; Net45 ]
-
-let private SimulatedMSBuildResolver =
-
- /// Get the path to the .NET Framework implementation assemblies by using ToolLocationHelper.GetPathToDotNetFramework
- /// This is only used to specify the "last resort" path for assembly resolution.
- let GetPathToDotNetFrameworkImlpementationAssemblies v =
- let v =
- match v with
- | Net45 -> Some TargetDotNetFrameworkVersion.Version45
- | Net451 -> Some TargetDotNetFrameworkVersion.Version451
- | Net452 -> Some TargetDotNetFrameworkVersion.Version452
- | Net46 -> Some TargetDotNetFrameworkVersion.Version46
- | Net461 -> Some TargetDotNetFrameworkVersion.Version461
- | Net462 -> Some TargetDotNetFrameworkVersion.Version462
- | Net47 -> Some TargetDotNetFrameworkVersion.Version47
- | Net471 -> Some TargetDotNetFrameworkVersion.Version471
- | Net472 -> Some TargetDotNetFrameworkVersion.Version472
- | Net48 -> Some TargetDotNetFrameworkVersion.Version48
- | _ ->
- assert false
- None
-
- match v with
- | Some v ->
- match ToolLocationHelper.GetPathToDotNetFramework v with
- | null -> []
- | x -> [ x ]
- | _ -> []
-
- let GetPathToDotNetFrameworkReferenceAssemblies version =
-#if NETSTANDARD
- ignore version
- let r: string list = []
- r
-#else
- match Microsoft.Build.Utilities.ToolLocationHelper.GetPathToStandardLibraries(".NETFramework", version, "") with
- | null
- | "" -> []
- | x -> [ x ]
-#endif
-
- { new ILegacyReferenceResolver with
- member x.HighestInstalledNetFrameworkVersion() =
-
- let root = x.DotNetFrameworkReferenceAssembliesRootDirectory
-
- let fwOpt =
- SupportedDesktopFrameworkVersions
- |> Seq.tryFind (fun fw -> FileSystem.DirectoryExistsShim(Path.Combine(root, fw)))
-
- match fwOpt with
- | Some fw -> fw
- | None -> "v4.5"
-
- member _.DotNetFrameworkReferenceAssembliesRootDirectory =
- if Environment.OSVersion.Platform = PlatformID.Win32NT then
- let PF =
- match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
- | null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF
- | s -> s
-
- PF + @"\Reference Assemblies\Microsoft\Framework\.NETFramework"
+ open System
+ open System.IO
+ open System.Reflection
+ open Internal.Utilities.Library
+ open FSharp.Compiler.IO
+
+ // ATTENTION!: the following code needs to be updated every time we are switching to the new MSBuild version because new .NET framework version was released
+ // 1. List of frameworks
+ // 2. DeriveTargetFrameworkDirectoriesFor45Plus
+ // 3. HighestInstalledRefAssembliesOrDotNETFramework
+ // 4. GetPathToDotNetFrameworkImlpementationAssemblies
+ []
+ let private Net45 = "v4.5"
+
+ []
+ let private Net451 = "v4.5.1"
+
+ []
+ let private Net452 = "v4.5.2" // not available in Dev15 MSBuild version
+
+ []
+ let private Net46 = "v4.6"
+
+ []
+ let private Net461 = "v4.6.1"
+
+ []
+ let private Net462 = "v4.6.2"
+
+ []
+ let private Net47 = "v4.7"
+
+ []
+ let private Net471 = "v4.7.1"
+
+ []
+ let private Net472 = "v4.7.2"
+
+ []
+ let private Net48 = "v4.8"
+
+ let SupportedDesktopFrameworkVersions =
+ [ Net48; Net472; Net471; Net47; Net462; Net461; Net46; Net452; Net451; Net45 ]
+
+ let private SimulatedMSBuildResolver =
+
+ /// Get the path to the .NET Framework implementation assemblies by using ToolLocationHelper.GetPathToDotNetFramework
+ /// This is only used to specify the "last resort" path for assembly resolution.
+ let GetPathToDotNetFrameworkImlpementationAssemblies _ =
+ let isDesktop = typeof.Assembly.GetName().Name = "mscorlib"
+ if isDesktop then
+ match System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() with
+ | null -> []
+ | x -> [ x ]
else
- ""
-
- member _.Resolve
- (
- resolutionEnvironment,
- references,
- targetFrameworkVersion,
- targetFrameworkDirectories,
- targetProcessorArchitecture,
- fsharpCoreDir,
- explicitIncludeDirs,
- implicitIncludeDir,
- logMessage,
- logWarningOrError
- ) =
-
-
- let results = ResizeArray()
-
- let searchPaths =
- [
- yield! targetFrameworkDirectories
- yield! explicitIncludeDirs
- yield fsharpCoreDir
- yield implicitIncludeDir
- yield! GetPathToDotNetFrameworkReferenceAssemblies targetFrameworkVersion
- yield! GetPathToDotNetFrameworkImlpementationAssemblies targetFrameworkVersion
- ]
-
- for r, baggage in references do
- //printfn "resolving %s" r
- let mutable found = false
-
- let success path =
- if not found then
- //printfn "resolved %s --> %s" r path
- found <- true
-
- results.Add
- {
- itemSpec = path
- prepareToolTip = snd
- baggage = baggage
- }
-
- try
- if not found && FileSystem.IsPathRootedShim r then
- if FileSystem.FileExistsShim r then success r
- with e ->
- logWarningOrError false "SR001" (e.ToString())
-
- // For this one we need to get the version search exactly right, without doing a load
- try
- if not found
- && r.StartsWithOrdinal("FSharp.Core, Version=")
- && Environment.OSVersion.Platform = PlatformID.Win32NT then
- let n = AssemblyName r
-
- let fscoreDir0 =
- let PF =
- match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
- | null -> Environment.GetEnvironmentVariable("ProgramFiles")
- | s -> s
-
- PF
- + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\"
- + n.Version.ToString()
-
- let trialPath = Path.Combine(fscoreDir0, n.Name + ".dll")
-
- if FileSystem.FileExistsShim trialPath then
- success trialPath
- with e ->
- logWarningOrError false "SR001" (e.ToString())
-
- let isFileName =
- r.EndsWith("dll", StringComparison.OrdinalIgnoreCase)
- || r.EndsWith("exe", StringComparison.OrdinalIgnoreCase)
-
- let qual =
- if isFileName then
- r
- else
- try
- AssemblyName(r).Name + ".dll"
- with _ ->
- r + ".dll"
+ []
+
+ let GetPathToDotNetFrameworkReferenceAssemblies version =
+ ignore version
+ let r: string list = []
+ r
+
+ { new ILegacyReferenceResolver with
+ member x.HighestInstalledNetFrameworkVersion() =
+
+ let root = x.DotNetFrameworkReferenceAssembliesRootDirectory
+
+ let fwOpt =
+ SupportedDesktopFrameworkVersions
+ |> Seq.tryFind (fun fw -> FileSystem.DirectoryExistsShim(Path.Combine(root, fw)))
+
+ match fwOpt with
+ | Some fw -> fw
+ | None -> Net45
+
+
+ member _.DotNetFrameworkReferenceAssembliesRootDirectory =
+ if Environment.OSVersion.Platform = PlatformID.Win32NT then
+ let PF =
+ match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
+ | null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF
+ | s -> s
+
+ PF + @"\Reference Assemblies\Microsoft\Framework\.NETFramework"
+ else
+ ""
+
+ member _.Resolve
+ (
+ resolutionEnvironment,
+ references,
+ targetFrameworkVersion,
+ targetFrameworkDirectories,
+ targetProcessorArchitecture,
+ fsharpCoreDir,
+ explicitIncludeDirs,
+ implicitIncludeDir,
+ logMessage,
+ logWarningOrError
+ ) =
+
+
+ let results = ResizeArray()
+
+ let searchPaths =
+ [
+ yield! targetFrameworkDirectories
+ yield! explicitIncludeDirs
+ yield fsharpCoreDir
+ yield implicitIncludeDir
+ yield! GetPathToDotNetFrameworkReferenceAssemblies targetFrameworkVersion
+ yield! GetPathToDotNetFrameworkImlpementationAssemblies targetFrameworkVersion
+ ]
+
+ for r, baggage in references do
+ //printfn "resolving %s" r
+ let mutable found = false
+
+ let success path =
+ if not found then
+ //printfn "resolved %s --> %s" r path
+ found <- true
+
+ results.Add
+ {
+ itemSpec = path
+ prepareToolTip = snd
+ baggage = baggage
+ }
- for searchPath in searchPaths do
try
- if not found then
- let trialPath = Path.Combine(searchPath, qual)
+ if not found && FileSystem.IsPathRootedShim r then
+ if FileSystem.FileExistsShim r then success r
+ with e ->
+ logWarningOrError false "SR001" (e.ToString())
+
+ // For this one we need to get the version search exactly right, without doing a load
+ try
+ if not found
+ && r.StartsWithOrdinal("FSharp.Core, Version=")
+ && Environment.OSVersion.Platform = PlatformID.Win32NT then
+ let n = AssemblyName r
+
+ let fscoreDir0 =
+ let PF =
+ match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
+ | null -> Environment.GetEnvironmentVariable("ProgramFiles")
+ | s -> s
+
+ PF
+ + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\"
+ + n.Version.ToString()
+
+ let trialPath = Path.Combine(fscoreDir0, n.Name + ".dll")
if FileSystem.FileExistsShim trialPath then
success trialPath
with e ->
logWarningOrError false "SR001" (e.ToString())
- try
- // Search the GAC on Windows
- if not found
- && not isFileName
- && Environment.OSVersion.Platform = PlatformID.Win32NT then
- let n = AssemblyName r
- let netFx = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
-
- let gac =
- Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(netFx.TrimEnd('\\'))), "assembly")
-
- match n.Version, n.GetPublicKeyToken() with
- | null, _
- | _, null ->
- let options =
- [
- if FileSystem.DirectoryExistsShim gac then
- for gacDir in FileSystem.EnumerateDirectoriesShim gac do
- let assemblyDir = Path.Combine(gacDir, n.Name)
-
- if FileSystem.DirectoryExistsShim assemblyDir then
- for tdir in FileSystem.EnumerateDirectoriesShim assemblyDir do
- let trialPath = Path.Combine(tdir, qual)
- if FileSystem.FileExistsShim trialPath then yield trialPath
- ]
- //printfn "sorting GAC paths: %A" options
- options
- |> List.sort // puts latest version last
- |> List.tryLast
- |> function
- | None -> ()
- | Some p -> success p
-
- | v, tok ->
- if FileSystem.DirectoryExistsShim gac then
- for gacDir in Directory.EnumerateDirectories gac do
- //printfn "searching GAC directory: %s" gacDir
- let assemblyDir = Path.Combine(gacDir, n.Name)
-
- if FileSystem.DirectoryExistsShim assemblyDir then
- //printfn "searching GAC directory: %s" assemblyDir
-
- let tokText = String.concat "" [| for b in tok -> sprintf "%02x" b |]
- let verDir = Path.Combine(assemblyDir, "v4.0_" + v.ToString() + "__" + tokText)
- //printfn "searching GAC directory: %s" verDir
-
- if FileSystem.DirectoryExistsShim verDir then
- let trialPath = Path.Combine(verDir, qual)
- //printfn "searching GAC: %s" trialPath
- if FileSystem.FileExistsShim trialPath then
- success trialPath
- with e ->
- logWarningOrError false "SR001" (e.ToString())
-
- results.ToArray()
- }
- |> LegacyReferenceResolver
-
-let internal getResolver () = SimulatedMSBuildResolver
-
-#if INTERACTIVE
-// Some manual testing
-SimulatedMSBuildResolver.DotNetFrameworkReferenceAssembliesRootDirectory
-SimulatedMSBuildResolver.HighestInstalledNetFrameworkVersion()
-
-let fscoreDir =
- if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows
- let PF =
- match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
- | null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF
- | s -> s
-
- PF + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.0.0"
- else
- System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
-
-let resolve s =
- SimulatedMSBuildResolver.Resolve(
- ResolutionEnvironment.EditingOrCompilation,
- [| for a in s -> (a, "") |],
- "v4.5.1",
+ let isFileName =
+ r.EndsWith("dll", StringComparison.OrdinalIgnoreCase)
+ || r.EndsWith("exe", StringComparison.OrdinalIgnoreCase)
+
+ let qual =
+ if isFileName then
+ r
+ else
+ try
+ AssemblyName(r).Name + ".dll"
+ with _ ->
+ r + ".dll"
+
+ for searchPath in searchPaths do
+ try
+ if not found then
+ let trialPath = Path.Combine(searchPath, qual)
+
+ if FileSystem.FileExistsShim trialPath then
+ success trialPath
+ with e ->
+ logWarningOrError false "SR001" (e.ToString())
+
+ try
+ // Search the GAC on Windows
+ if not found
+ && not isFileName
+ && Environment.OSVersion.Platform = PlatformID.Win32NT then
+ let n = AssemblyName r
+ let netFx = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
+
+ let gac =
+ Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(netFx.TrimEnd('\\'))), "assembly")
+
+ match n.Version, n.GetPublicKeyToken() with
+ | null, _
+ | _, null ->
+ let options =
+ [
+ if FileSystem.DirectoryExistsShim gac then
+ for gacDir in FileSystem.EnumerateDirectoriesShim gac do
+ let assemblyDir = Path.Combine(gacDir, n.Name)
+
+ if FileSystem.DirectoryExistsShim assemblyDir then
+ for tdir in FileSystem.EnumerateDirectoriesShim assemblyDir do
+ let trialPath = Path.Combine(tdir, qual)
+ if FileSystem.FileExistsShim trialPath then yield trialPath
+ ]
+ //printfn "sorting GAC paths: %A" options
+ options
+ |> List.sort // puts latest version last
+ |> List.tryLast
+ |> function
+ | None -> ()
+ | Some p -> success p
+
+ | v, tok ->
+ if FileSystem.DirectoryExistsShim gac then
+ for gacDir in Directory.EnumerateDirectories gac do
+ //printfn "searching GAC directory: %s" gacDir
+ let assemblyDir = Path.Combine(gacDir, n.Name)
+
+ if FileSystem.DirectoryExistsShim assemblyDir then
+ //printfn "searching GAC directory: %s" assemblyDir
+
+ let tokText = String.concat "" [| for b in tok -> sprintf "%02x" b |]
+ let verDir = Path.Combine(assemblyDir, "v4.0_" + v.ToString() + "__" + tokText)
+ //printfn "searching GAC directory: %s" verDir
+
+ if FileSystem.DirectoryExistsShim verDir then
+ let trialPath = Path.Combine(verDir, qual)
+ //printfn "searching GAC: %s" trialPath
+ if FileSystem.FileExistsShim trialPath then
+ success trialPath
+ with e ->
+ logWarningOrError false "SR001" (e.ToString())
+
+ results.ToArray()
+ }
+ |> LegacyReferenceResolver
+
+ let internal getResolver () = SimulatedMSBuildResolver
+
+ #if INTERACTIVE
+ // Some manual testing
+ SimulatedMSBuildResolver.DotNetFrameworkReferenceAssembliesRootDirectory
+ SimulatedMSBuildResolver.HighestInstalledNetFrameworkVersion()
+
+ let fscoreDir =
+ if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows
+ let PF =
+ match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
+ | null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF
+ | s -> s
+
+ PF + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.0.0"
+ else
+ System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
+
+ let resolve s =
+ SimulatedMSBuildResolver.Resolve(
+ ResolutionEnvironment.EditingOrCompilation,
+ [| for a in s -> (a, "") |],
+ "v4.5.1",
+ [
+ SimulatedMSBuildResolver.DotNetFrameworkReferenceAssembliesRootDirectory
+ + @"\v4.5.1"
+ ],
+ "",
+ "",
+ fscoreDir,
+ [],
+ __SOURCE_DIRECTORY__,
+ ignore,
+ (fun _ _ -> ()),
+ (fun _ _ -> ())
+ )
+
+ // Resolve partial name to something on search path
+ resolve [ "FSharp.Core" ]
+
+ // Resolve DLL name to something on search path
+ resolve [ "FSharp.Core.dll" ]
+
+ // Resolve from reference assemblies
+ resolve [ "System"; "mscorlib"; "mscorlib.dll" ]
+
+ // Resolve from Registry AssemblyFolders
+ resolve [ "Microsoft.SqlServer.Dmf.dll"; "Microsoft.SqlServer.Dmf" ]
+
+ // Resolve exact version of FSharp.Core
+ resolve
+ [
+ "FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
+ ]
+
+ // Resolve from GAC:
+ resolve
+ [
+ "EventViewer, Version=6.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
+ ]
+
+ // Resolve from GAC:
+ resolve [ "EventViewer" ]
+
+ resolve
+ [
+ "Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
+ ]
+
+ resolve
[
- SimulatedMSBuildResolver.DotNetFrameworkReferenceAssembliesRootDirectory
- + @"\v4.5.1"
- ],
- "",
- "",
- fscoreDir,
- [],
- __SOURCE_DIRECTORY__,
- ignore,
- (fun _ _ -> ()),
- (fun _ _ -> ())
- )
-
-// Resolve partial name to something on search path
-resolve [ "FSharp.Core" ]
-
-// Resolve DLL name to something on search path
-resolve [ "FSharp.Core.dll" ]
-
-// Resolve from reference assemblies
-resolve [ "System"; "mscorlib"; "mscorlib.dll" ]
-
-// Resolve from Registry AssemblyFolders
-resolve [ "Microsoft.SqlServer.Dmf.dll"; "Microsoft.SqlServer.Dmf" ]
-
-// Resolve exact version of FSharp.Core
-resolve
- [
- "FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
- ]
-
-// Resolve from GAC:
-resolve
- [
- "EventViewer, Version=6.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
- ]
-
-// Resolve from GAC:
-resolve [ "EventViewer" ]
-
-resolve
- [
- "Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
- ]
-
-resolve
- [
- "Microsoft.SharePoint.Client, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
- ]
-#endif
+ "Microsoft.SharePoint.Client, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
+ ]
+ #endif
diff --git a/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs b/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs
deleted file mode 100644
index 516695e7e188317dfee8e81983017aea7d6ed4c5..0000000000000000000000000000000000000000
--- a/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs
+++ /dev/null
@@ -1,366 +0,0 @@
-// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
-
-module FSharp.Compiler.CodeAnalysis.LegacyMSBuildReferenceResolver
-
- open System
- open System.IO
- open System.Reflection
- open Internal.Utilities.Library
- open Microsoft.Build.Tasks
- open Microsoft.Build.Utilities
- open Microsoft.Build.Framework
- open FSharp.Compiler.IO
-
- // Reflection wrapper for properties
- type Object with
- member this.GetPropertyValue(propName) =
- this.GetType().GetProperty(propName, BindingFlags.Public).GetValue(this, null)
-
- /// Get the Reference Assemblies directory for the .NET Framework on Window.
- let DotNetFrameworkReferenceAssembliesRootDirectory =
- // ProgramFilesX86 is correct for both x86 and x64 architectures
- // (the reference assemblies are always in the 32-bit location, which is PF(x86) on an x64 machine)
- let PF =
- match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
- | Null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF
- | NonNull s -> s
- PF + @"\Reference Assemblies\Microsoft\Framework\.NETFramework"
-
- /// When targeting .NET 2.0-3.5 on Windows, we expand the {WindowsFramework} and {ReferenceAssemblies} paths manually
- let internal ReplaceVariablesForLegacyFxOnWindows(dirs: string list) =
- let windowsFramework = Environment.GetEnvironmentVariable("windir")+ @"\Microsoft.NET\Framework"
- let referenceAssemblies = DotNetFrameworkReferenceAssembliesRootDirectory
- dirs |> List.map(fun d -> d.Replace("{WindowsFramework}",windowsFramework).Replace("{ReferenceAssemblies}",referenceAssemblies))
-
- // ATTENTION!: the following code needs to be updated every time we are switching to the new MSBuild version because new .NET framework version was released
- // 1. List of frameworks
- // 2. DeriveTargetFrameworkDirectoriesFor45Plus
- // 3. HighestInstalledRefAssembliesOrDotNETFramework
- // 4. GetPathToDotNetFrameworkImlpementationAssemblies
- []
- let private Net45 = "v4.5"
-
- []
- let private Net451 = "v4.5.1"
-
- []
- let private Net452 = "v4.5.2" // not available in Dev15 MSBuild version
-
- []
- let private Net46 = "v4.6"
-
- []
- let private Net461 = "v4.6.1"
-
- []
- let private Net462 = "v4.6.2"
-
- []
- let private Net47 = "v4.7"
-
- []
- let private Net471 = "v4.7.1"
-
- []
- let private Net472 = "v4.7.2"
-
- []
- let private Net48 = "v4.8"
-
- let SupportedDesktopFrameworkVersions = [ Net48; Net472; Net471; Net47; Net462; Net461; Net46; Net452; Net451; Net45 ]
-
- /// Get the path to the .NET Framework implementation assemblies by using ToolLocationHelper.GetPathToDotNetFramework
- /// This is only used to specify the "last resort" path for assembly resolution.
- let GetPathToDotNetFrameworkImlpementationAssemblies v : string list =
- let v =
- match v with
- | Net45 -> Some TargetDotNetFrameworkVersion.Version45
- | Net451 -> Some TargetDotNetFrameworkVersion.Version451
- | Net452 -> Some TargetDotNetFrameworkVersion.Version452
- | Net46 -> Some TargetDotNetFrameworkVersion.Version46
- | Net461 -> Some TargetDotNetFrameworkVersion.Version461
- | Net462 -> Some TargetDotNetFrameworkVersion.Version462
- | Net47 -> Some TargetDotNetFrameworkVersion.Version47
- | Net471 -> Some TargetDotNetFrameworkVersion.Version471
- | Net472 -> Some TargetDotNetFrameworkVersion.Version472
- | Net48 -> Some TargetDotNetFrameworkVersion.Version48
- | _ -> assert false; None
- match v with
- | Some v ->
- match ToolLocationHelper.GetPathToDotNetFramework v with
- | Null -> []
- | NonNull x -> [x]
- | _ -> []
-
- let GetPathToDotNetFrameworkReferenceAssemblies version =
-#if NETSTANDARD
- ignore version
- let r : string list = []
- r
-#else
- match Microsoft.Build.Utilities.ToolLocationHelper.GetPathToStandardLibraries(".NETFramework",version,"") with
- | Null | "" -> []
- | NonNull x -> [x]
-#endif
-
- /// Use MSBuild to determine the version of the highest installed set of reference assemblies, failing that grab the highest installed framework version
- let HighestInstalledRefAssembliesOrDotNETFramework () =
- let getHighestInstalledDotNETFramework () =
- try
- if box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version48)) <> null then Net48
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version472)) <> null then Net472
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version471)) <> null then Net471
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version47)) <> null then Net47
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version462)) <> null then Net462
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version461)) <> null then Net461
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version461)) <> null then Net461
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version46)) <> null then Net46
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version452)) <> null then Net452
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451)) <> null then Net451
- elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version45)) <> null then Net45
- else Net45 // version is 4.5 assumed since this code is running.
- with _ -> Net45
-
- // 1. First look to see if we can find the highest installed set of dotnet reference assemblies, if yes then select that framework
- // 2. Otherwise ask msbuild for the highestinstalled framework
- let checkFrameworkForReferenceAssemblies (dotNetVersion:string) =
- if not (String.IsNullOrEmpty(dotNetVersion)) then
- try
- let v = if dotNetVersion.StartsWith("v") then dotNetVersion.Substring(1) else dotNetVersion
- let frameworkName = System.Runtime.Versioning.FrameworkName(".NETFramework", Version(v))
- match ToolLocationHelper.GetPathToReferenceAssemblies(frameworkName) |> Seq.tryHead with
- | Some p -> FileSystem.DirectoryExistsShim(p)
- | None -> false
- with _ -> false
- else false
- match SupportedDesktopFrameworkVersions |> Seq.tryFind(fun v -> checkFrameworkForReferenceAssemblies v) with
- | Some v -> v
- | None -> getHighestInstalledDotNETFramework()
-
- /// Derive the target framework directories.
- let DeriveTargetFrameworkDirectories (targetFrameworkVersion:string, logMessage) =
-
- let targetFrameworkVersion =
- if not(targetFrameworkVersion.StartsWith("v",StringComparison.Ordinal)) then "v"+targetFrameworkVersion
- else targetFrameworkVersion
-
- let result = GetPathToDotNetFrameworkReferenceAssemblies(targetFrameworkVersion) |> Array.ofList
- logMessage (sprintf "Derived target framework directories for version %s are: %s" targetFrameworkVersion (String.Join(",", result)))
- result
-
- /// Describes the location where the reference was found, used only for debug and tooltip output
- type ResolvedFrom =
- | AssemblyFolders
- | AssemblyFoldersEx
- | TargetFrameworkDirectory
- | RawFileName
- | GlobalAssemblyCache
- | Path of string
- | Unknown
-
- /// Decode the ResolvedFrom code from MSBuild.
- let DecodeResolvedFrom(resolvedFrom:string) : ResolvedFrom =
- match resolvedFrom with
- | "{RawFileName}" -> RawFileName
- | "{GAC}" -> GlobalAssemblyCache
- | "{TargetFrameworkDirectory}" -> TargetFrameworkDirectory
- | "{AssemblyFolders}" -> AssemblyFolders
- | r when r.Length >= 10 && "{Registry:" = r.Substring(0,10) -> AssemblyFoldersEx
- | r -> ResolvedFrom.Path r
-
- let TooltipForResolvedFrom(resolvedFrom, fusionName, redist) =
- fun (originalReference,resolvedPath) ->
- let originalReferenceName = originalReference
-
- let resolvedPath = // Don't show the resolved path if it is identical to what was referenced.
- if originalReferenceName = resolvedPath then String.Empty
- else resolvedPath
-
- let lineIfExists text =
- if String.IsNullOrEmpty text then ""
- else text.Trim(' ')+"\n"
-
- match resolvedFrom with
- | AssemblyFolders ->
- lineIfExists resolvedPath
- + lineIfExists fusionName
- + FSComp.SR.assemblyResolutionFoundByAssemblyFoldersKey()
- | AssemblyFoldersEx ->
- lineIfExists resolvedPath
- + lineIfExists fusionName
- + FSComp.SR.assemblyResolutionFoundByAssemblyFoldersExKey()
- | TargetFrameworkDirectory ->
- lineIfExists resolvedPath
- + lineIfExists fusionName
- + FSComp.SR.assemblyResolutionNetFramework()
- | Unknown ->
- // Unknown when resolved by plain directory search without help from MSBuild resolver.
- lineIfExists resolvedPath
- + lineIfExists fusionName
- | RawFileName ->
- lineIfExists fusionName
- | GlobalAssemblyCache ->
- lineIfExists fusionName
- + lineIfExists (FSComp.SR.assemblyResolutionGAC())
- + lineIfExists redist
- | Path _ ->
- lineIfExists resolvedPath
- + lineIfExists fusionName
-
- /// Perform assembly resolution by instantiating the ResolveAssembly task directly from the MSBuild SDK.
- let ResolveCore(resolutionEnvironment: LegacyResolutionEnvironment,
- references:(string*string)[],
- targetFrameworkVersion: string,
- targetFrameworkDirectories: string list,
- targetProcessorArchitecture: string,
- fsharpCoreDir: string,
- explicitIncludeDirs: string list,
- implicitIncludeDir: string,
- allowRawFileName: bool,
- logMessage: string -> unit,
- logDiagnostic: bool -> string -> string -> unit) =
-
- let frameworkRegistryBase, assemblyFoldersSuffix, assemblyFoldersConditions =
- "Software\Microsoft\.NetFramework", "AssemblyFoldersEx" , ""
- if Array.isEmpty references then [| |] else
-
- let mutable backgroundException = false
-
- let protect f =
- if not backgroundException then
- try f()
- with _ -> backgroundException <- true
-
- let engine =
- { new IBuildEngine with
- member _.BuildProjectFile(projectFileName, targetNames, globalProperties, targetOutputs) = true
- member _.LogCustomEvent(e) = protect (fun () -> logMessage e.Message)
- member _.LogErrorEvent(e) = protect (fun () -> logDiagnostic true e.Code e.Message)
- member _.LogMessageEvent(e) = protect (fun () -> logMessage e.Message)
- member _.LogWarningEvent(e) = protect (fun () -> logDiagnostic false e.Code e.Message)
- member _.ColumnNumberOfTaskNode with get() = 1
- member _.LineNumberOfTaskNode with get() = 1
- member _.ContinueOnError with get() = true
- member _.ProjectFileOfTaskNode with get() = "" }
-
- // Derive the target framework directory if none was supplied.
- let targetFrameworkDirectories =
- if targetFrameworkDirectories=[] then DeriveTargetFrameworkDirectories(targetFrameworkVersion, logMessage)
- else targetFrameworkDirectories |> Array.ofList
-
-
- // Filter for null and zero length
- let references = references |> Array.filter(fst >> String.IsNullOrEmpty >> not)
-
- // Determine the set of search paths for the resolution
- let searchPaths =
-
- let explicitIncludeDirs = explicitIncludeDirs |> List.filter(String.IsNullOrEmpty >> not)
-
- let registry = sprintf "{Registry:%s,%s,%s%s}" frameworkRegistryBase targetFrameworkVersion assemblyFoldersSuffix assemblyFoldersConditions
-
- [| // When compiling scripts using fsc.exe, for some reason we have always historically put TargetFrameworkDirectory first
- // It is unclear why. This is the only place we look at the 'isdifference between ResolutionEnvironment.EditingOrCompilation and ResolutionEnvironment.EditingTime.
- match resolutionEnvironment with
- | LegacyResolutionEnvironment.EditingOrCompilation false -> yield "{TargetFrameworkDirectory}"
- | LegacyResolutionEnvironment.EditingOrCompilation true
- | LegacyResolutionEnvironment.CompilationAndEvaluation -> ()
-
- // Quick-resolve straight to file name first
- if allowRawFileName then
- yield "{RawFileName}"
- yield! explicitIncludeDirs // From -I, #I
- yield fsharpCoreDir // Location of explicit reference to FSharp.Core, otherwise location of fsc.exe
- yield implicitIncludeDir // Usually the project directory
-
- match resolutionEnvironment with
- | LegacyResolutionEnvironment.EditingOrCompilation true
- | LegacyResolutionEnvironment.CompilationAndEvaluation -> yield "{TargetFrameworkDirectory}"
- | LegacyResolutionEnvironment.EditingOrCompilation false -> ()
-
- yield registry
- yield "{AssemblyFolders}"
- yield "{GAC}"
- // use path to implementation assemblies as the last resort
- yield! GetPathToDotNetFrameworkImlpementationAssemblies targetFrameworkVersion
- |]
-
- let assemblies =
- [| for referenceName,baggage in references ->
- let item = TaskItem(referenceName) :> ITaskItem
- item.SetMetadata("Baggage", baggage)
- item |]
- let rar =
- ResolveAssemblyReference(BuildEngine=engine, TargetFrameworkDirectories=targetFrameworkDirectories,
- FindRelatedFiles=false, FindDependencies=false, FindSatellites=false,
- FindSerializationAssemblies=false, Assemblies=assemblies,
- SearchPaths=searchPaths,
- AllowedAssemblyExtensions= [| ".dll" ; ".exe" |])
- rar.TargetProcessorArchitecture <- targetProcessorArchitecture
- let targetedRuntimeVersionValue = typeof.Assembly.ImageRuntimeVersion
- rar.TargetedRuntimeVersion <- targetedRuntimeVersionValue
- rar.CopyLocalDependenciesWhenParentReferenceInGac <- true
-
- let succeeded = rar.Execute()
-
- if not succeeded then
- raise LegacyResolutionFailure
-
- let resolvedFiles =
- [| for p in rar.ResolvedFiles ->
- let resolvedFrom = DecodeResolvedFrom(p.GetMetadata("ResolvedFrom"))
- let fusionName = p.GetMetadata("FusionName")
- let redist = p.GetMetadata("Redist")
- { itemSpec = p.ItemSpec
- prepareToolTip = TooltipForResolvedFrom(resolvedFrom, fusionName, redist)
- baggage = p.GetMetadata("Baggage") } |]
-
- resolvedFiles
-
- let getResolver () =
- { new ILegacyReferenceResolver with
- member _.HighestInstalledNetFrameworkVersion() = HighestInstalledRefAssembliesOrDotNETFramework()
- member _.DotNetFrameworkReferenceAssembliesRootDirectory = DotNetFrameworkReferenceAssembliesRootDirectory
-
- /// Perform the resolution on rooted and unrooted paths, and then combine the results.
- member _.Resolve(resolutionEnvironment, references, targetFrameworkVersion, targetFrameworkDirectories, targetProcessorArchitecture,
- fsharpCoreDir, explicitIncludeDirs, implicitIncludeDir, logMessage, logDiagnostic) =
-
- // The {RawFileName} target is 'dangerous', in the sense that is uses Directory.GetCurrentDirectory() to resolve unrooted file paths.
- // It is unreliable to use this mutable global state inside Visual Studio. As a result, we partition all references into a "rooted" set
- // (which contains e.g. C:\MyDir\MyAssem.dll) and "unrooted" (everything else). We only allow "rooted" to use {RawFileName}. Note that
- // unrooted may still find 'local' assemblies by virtue of the fact that "implicitIncludeDir" is one of the places searched during
- // assembly resolution.
- let references =
- [| for fileName, baggage as data in references ->
- // However, MSBuild will not resolve 'relative' paths, even when e.g. implicitIncludeDir is part of the search. As a result,
- // if we have an unrooted path + file name, we'll assume this is relative to the project directory and root it.
- if FileSystem.IsPathRootedShim(fileName) then
- data // fine, e.g. "C:\Dir\foo.dll"
- elif not(fileName.Contains("\\") || fileName.Contains("/")) then
- data // fine, e.g. "System.Transactions.dll"
- else
- // We have a 'relative path', e.g. "bin/Debug/foo.exe" or "..\Yadda\bar.dll"
- // turn it into an absolute path based at implicitIncludeDir
- (Path.Combine(implicitIncludeDir, fileName), baggage) |]
-
- let rooted, unrooted = references |> Array.partition (fst >> FileSystem.IsPathRootedShim)
-
- let rootedResults =
- ResolveCore
- (resolutionEnvironment, rooted, targetFrameworkVersion,
- targetFrameworkDirectories, targetProcessorArchitecture,
- fsharpCoreDir, explicitIncludeDirs, implicitIncludeDir,
- true, logMessage, logDiagnostic)
-
- let unrootedResults =
- ResolveCore
- (resolutionEnvironment, unrooted, targetFrameworkVersion,
- targetFrameworkDirectories, targetProcessorArchitecture,
- fsharpCoreDir, explicitIncludeDirs, implicitIncludeDir,
- false, logMessage, logDiagnostic)
-
- // now unify the two sets of results
- Array.concat [| rootedResults; unrootedResults |]
- }
- |> LegacyReferenceResolver
diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf
index 449b0458655ca466d2b812f8a8d1077a7be2cbdf..7ad080d2aafa0524febabed0521725d363a66480 100644
--- a/src/Compiler/xlf/FSComp.txt.cs.xlf
+++ b/src/Compiler/xlf/FSComp.txt.cs.xlf
@@ -5662,26 +5662,6 @@
generovaný typ
-
-
- Nalezené klíčem registru AssemblyFolders
-
-
-
-
- Nalezené klíčem registru AssemblyFoldersEx
-
-
-
-
- .NET Framework
-
-
-
-
- Globální mezipaměť sestavení
-
- Rekurzivní hierarchie tříd u typu {0}
diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf
index 77d6ad765e67e19ddee0add571663df8ec815058..fbb0a7bfb34c6c4ad6e4bbb18d525ca67c065f32 100644
--- a/src/Compiler/xlf/FSComp.txt.de.xlf
+++ b/src/Compiler/xlf/FSComp.txt.de.xlf
@@ -5662,26 +5662,6 @@
Generierter Typ
-
-
- Von AssemblyFolders-Registrierungsschlüssel gefunden
-
-
-
-
- Von AssemblyFoldersEx-Registrierungsschlüssel gefunden
-
-
-
-
- .NET Framework
-
-
-
-
- Globaler Assemblycache
-
- Rekursive Klassenhierarchie in Typ "{0}".
diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf
index 6820dfa57c3a81183dc3410bc1b4f9ff14dfa046..7d8aca4e042ad7f9a4db8fee2b99d1f98ad5ec54 100644
--- a/src/Compiler/xlf/FSComp.txt.es.xlf
+++ b/src/Compiler/xlf/FSComp.txt.es.xlf
@@ -5662,26 +5662,6 @@
tipo generado
-
-
- Encontrado por la clave del Registro AssemblyFolders.
-
-
-
-
- Encontrado por la clave del Registro AssemblyFoldersEx.
-
-
-
-
- .NET Framework
-
-
-
-
- Caché global de ensamblados
-
- Jerarquía de clases recursiva en el tipo '{0}'.
diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf
index a5373e5d417425afed251562689b4bf307f7eb48..bb507ae5dd8210111983b7cf771a4f17b135469f 100644
--- a/src/Compiler/xlf/FSComp.txt.fr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.fr.xlf
@@ -5662,26 +5662,6 @@
type généré
-
-
- Trouvée par la clé de Registre AssemblyFolders
-
-
-
-
- Trouvée par la clé de Registre AssemblyFoldersEx
-
-
-
-
- .NET Framework
-
-
-
-
- Global Assembly Cache
-
- Hiérarchie de classes récursive dans le type '{0}'
diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf
index 6b7ae17814c6d19f361eaec9ff8e8830ba60d63d..e07ab4a3b59a5490a124847149ef51c0108e05eb 100644
--- a/src/Compiler/xlf/FSComp.txt.it.xlf
+++ b/src/Compiler/xlf/FSComp.txt.it.xlf
@@ -5662,26 +5662,6 @@
tipo generato
-
-
- Trovata mediante la chiave del Registro di sistema AssemblyFolders
-
-
-
-
- Trovata mediante chiave del Registro di sistema AssemblyFoldersEx
-
-
-
-
- .NET Framework
-
-
-
-
- Global Assembly Cache
-
- Gerarchia di classi ricorsiva nel tipo '{0}'
diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf
index 62c7da5d8779d98a650e21119b8df0ce0e91ef7c..1f0084d754123fe99d79740109c96d7801257c53 100644
--- a/src/Compiler/xlf/FSComp.txt.ja.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ja.xlf
@@ -5662,26 +5662,6 @@
生成された型
-
-
- AssemblyFolders レジストリ キーによって検出されました
-
-
-
-
- AssemblyFoldersEx レジストリ キーによって検出されました
-
-
-
-
- .NET Framework
-
-
-
-
- グローバル アセンブリ キャッシュ
-
- 型 '{0}' の再帰的クラス階層
diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf
index 9b59f31bf19b15c1e4b7d32d75bb568b3ee832c3..42e39e8db3c65203afa0e9dd272c46d92083be03 100644
--- a/src/Compiler/xlf/FSComp.txt.ko.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ko.xlf
@@ -5662,26 +5662,6 @@
생성된 형식
-
-
- AssemblyFolders 레지스트리 키로 찾았습니다.
-
-
-
-
- AssemblyFoldersEx 레지스트리 키로 찾았습니다.
-
-
-
-
- .NET Framework
-
-
-
-
- 전역 어셈블리 캐시
-
- '{0}' 형식에 재귀적 클래스 계층 구조가 있습니다.
diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf
index 8afb7a5d6da95dc5a99a555054da318ded919cdb..24ec9716810331a5eb65aebabbeba8b73f6144ba 100644
--- a/src/Compiler/xlf/FSComp.txt.pl.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pl.xlf
@@ -5662,26 +5662,6 @@
wygenerowany typ
-
-
- Znalezione przez klucz rejestru AssemblyFolders
-
-
-
-
- Znalezione przez klucz rejestru AssemblyFoldersEx
-
-
-
-
- .NET Framework
-
-
-
-
- Globalna pamięć podręczna zestawów
-
- Cykliczna hierarchia klas w typie „{0}”
diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
index 52f735b4d2b9dc0c79b47da566060f8373c3065c..7bbd44e07484cf23c2e17376eba6be6ac698d194 100644
--- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
@@ -5662,26 +5662,6 @@
tipo gerado
-
-
- Localizada pela chave de registro AssemblyFolders
-
-
-
-
- Localizada pela chave de registro AssemblyFoldersEx
-
-
-
-
- .NET Framework
-
-
-
-
- Cache de Assembly Global
-
- Hierarquia de classe recursiva no tipo '{0}'
diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf
index 01eecb840162a314dd58591c4d089464ff470c83..dcec58500e5f31d7a3fedad56cc0487b917a4890 100644
--- a/src/Compiler/xlf/FSComp.txt.ru.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ru.xlf
@@ -5662,26 +5662,6 @@
созданный тип
-
-
- Найдено по разделу реестра AssemblyFolders
-
-
-
-
- Найдено по разделу реестра AssemblyFoldersEx
-
-
-
-
- .NET Framework
-
-
-
-
- Глобальный кэш сборок
-
- Рекурсивная иерархия классов в типе "{0}"
diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf
index b781726302e2349bffd40ea88a339cebbcbfd0d4..fe7389a0a379f5800418dcd9f9ebfeb57dd9cd91 100644
--- a/src/Compiler/xlf/FSComp.txt.tr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.tr.xlf
@@ -5662,26 +5662,6 @@
oluşturulan tür
-
-
- AssemblyFolders kayıt defteri anahtarı ile bulunur
-
-
-
-
- AssemblyFoldersEx kayıt defteri anahtarı ile bulunur
-
-
-
-
- .NET Framework
-
-
-
-
- Genel Bütünleştirilmiş Kod Önbelleği
-
- '{0}' türünde özyinelemeli sınıf hiyerarşisi
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
index 91345ca33fb3ff00f9e350453887332dabcbaa29..a1f490de8994ac24eb38ee60445e051af9616e76 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
@@ -5662,26 +5662,6 @@
生成的类型
-
-
- 已由 AssemblyFolders 注册表项找到
-
-
-
-
- 已由 AssemblyFoldersEx 注册表项找到
-
-
-
-
- .NET Framework
-
-
-
-
- 全局程序集缓存
-
- 类型“{0}”中的递归类层次结构
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
index 9c068c0736c0473c9a3517afa519864d9d4f0e4a..00e26426d1763efad56d2b0e906bdb6071007b12 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
@@ -5662,26 +5662,6 @@
產生的類型
-
-
- 依 AssemblyFolders 登錄機碼找到
-
-
-
-
- 依 AssemblyFoldersEx 登錄機碼找到
-
-
-
-
- .NET Framework
-
-
-
-
- 全域組件快取
-
- 類型 '{0}' 中有遞迴的類別階層
diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs
index 8a1b526837aa4476d4e02d2427df465b52f42454..14f55dc6fb46070172e8a6cd3ea01ea52a876e98 100644
--- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs
+++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs
@@ -64,7 +64,6 @@ module internal Utilities =
|> Array.filter (fun r ->
not (String.IsNullOrEmpty(r.NugetPackageId) || String.IsNullOrEmpty(r.FullPath))
&& not (equals r.IsNotImplementationReference "true")
- && File.Exists(r.FullPath)
&& equals r.AssetType "runtime")
|> Array.map (fun r -> r.FullPath)
|> Array.distinct
@@ -260,7 +259,12 @@ module internal Utilities =
let resolutionsFile, resolutions, references, loads, includes =
if success && File.Exists(outputFile) then
let resolutions = getResolutionsFromFile outputFile
- let references = (findReferencesFromResolutions resolutions) |> Array.toList
+
+ let references =
+ (findReferencesFromResolutions resolutions)
+ |> Array.filter (File.Exists)
+ |> Array.toList
+
let loads = (findLoadsFromResolutions resolutions) |> Array.toList
let includes = (findIncludesFromResolutions resolutions) |> Array.toList
(Some outputFile), resolutions, references, loads, includes
diff --git a/src/LegacyMSBuildResolver/LegacyMSBuildReferenceResolver.fs b/src/LegacyMSBuildResolver/LegacyMSBuildReferenceResolver.fs
new file mode 100644
index 0000000000000000000000000000000000000000..977372d675a35285d8981c08f827604f44705221
--- /dev/null
+++ b/src/LegacyMSBuildResolver/LegacyMSBuildReferenceResolver.fs
@@ -0,0 +1,516 @@
+// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
+
+module FSharp.Compiler.CodeAnalysis.LegacyMSBuildReferenceResolver
+
+open System
+open System.IO
+open System.Reflection
+open Internal.Utilities.Library
+open Microsoft.Build.Tasks
+open Microsoft.Build.Utilities
+open Microsoft.Build.Framework
+open FSharp.Compiler.IO
+
+// Reflection wrapper for properties
+type Object with
+
+ member this.GetPropertyValue(propName) =
+ this.GetType().GetProperty(propName, BindingFlags.Public).GetValue(this, null)
+
+/// Match on the nullness of an argument.
+let inline (|Null|NonNull|) (x: 'T) : Choice =
+ match x with
+ | null -> Null
+ | v -> NonNull v
+
+/// Get the Reference Assemblies directory for the .NET Framework on Window.
+let DotNetFrameworkReferenceAssembliesRootDirectory =
+ // ProgramFilesX86 is correct for both x86 and x64 architectures
+ // (the reference assemblies are always in the 32-bit location, which is PF(x86) on an x64 machine)
+ let PF =
+ match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with
+ | Null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF
+ | NonNull s -> s
+
+ PF + @"\Reference Assemblies\Microsoft\Framework\.NETFramework"
+
+/// When targeting .NET 2.0-3.5 on Windows, we expand the {WindowsFramework} and {ReferenceAssemblies} paths manually
+let internal ReplaceVariablesForLegacyFxOnWindows (dirs: string list) =
+ let windowsFramework =
+ Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework"
+
+ let referenceAssemblies = DotNetFrameworkReferenceAssembliesRootDirectory
+
+ dirs
+ |> List.map (fun d ->
+ d
+ .Replace("{WindowsFramework}", windowsFramework)
+ .Replace("{ReferenceAssemblies}", referenceAssemblies))
+
+// ATTENTION!: the following code needs to be updated every time we are switching to the new MSBuild version because new .NET framework version was released
+// 1. List of frameworks
+// 2. DeriveTargetFrameworkDirectoriesFor45Plus
+// 3. HighestInstalledRefAssembliesOrDotNETFramework
+// 4. GetPathToDotNetFrameworkImlpementationAssemblies
+[]
+let private Net45 = "v4.5"
+
+[]
+let private Net451 = "v4.5.1"
+
+[]
+let private Net452 = "v4.5.2" // not available in Dev15 MSBuild version
+
+[]
+let private Net46 = "v4.6"
+
+[]
+let private Net461 = "v4.6.1"
+
+[]
+let private Net462 = "v4.6.2"
+
+[]
+let private Net47 = "v4.7"
+
+[]
+let private Net471 = "v4.7.1"
+
+[]
+let private Net472 = "v4.7.2"
+
+[]
+let private Net48 = "v4.8"
+
+let SupportedDesktopFrameworkVersions =
+ [ Net48; Net472; Net471; Net47; Net462; Net461; Net46; Net452; Net451; Net45 ]
+
+/// Get the path to the .NET Framework implementation assemblies by using ToolLocationHelper.GetPathToDotNetFramework
+/// This is only used to specify the "last resort" path for assembly resolution.
+let GetPathToDotNetFrameworkImlpementationAssemblies v : string list =
+ let v =
+ match v with
+ | Net45 -> Some TargetDotNetFrameworkVersion.Version45
+ | Net451 -> Some TargetDotNetFrameworkVersion.Version451
+ | Net452 -> Some TargetDotNetFrameworkVersion.Version452
+ | Net46 -> Some TargetDotNetFrameworkVersion.Version46
+ | Net461 -> Some TargetDotNetFrameworkVersion.Version461
+ | Net462 -> Some TargetDotNetFrameworkVersion.Version462
+ | Net47 -> Some TargetDotNetFrameworkVersion.Version47
+ | Net471 -> Some TargetDotNetFrameworkVersion.Version471
+ | Net472 -> Some TargetDotNetFrameworkVersion.Version472
+ | Net48 -> Some TargetDotNetFrameworkVersion.Version48
+ | _ ->
+ assert false
+ None
+
+ match v with
+ | Some v ->
+ match ToolLocationHelper.GetPathToDotNetFramework v with
+ | Null -> []
+ | NonNull x -> [ x ]
+ | _ -> []
+
+let GetPathToDotNetFrameworkReferenceAssemblies version =
+#if NETSTANDARD
+ ignore version
+ let r: string list = []
+ r
+#else
+ match Microsoft.Build.Utilities.ToolLocationHelper.GetPathToStandardLibraries(".NETFramework", version, "") with
+ | Null
+ | "" -> []
+ | NonNull x -> [ x ]
+#endif
+
+/// Use MSBuild to determine the version of the highest installed set of reference assemblies, failing that grab the highest installed framework version
+let HighestInstalledRefAssembliesOrDotNETFramework () =
+ let getHighestInstalledDotNETFramework () =
+ try
+ if
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version48))
+ <> null
+ then
+ Net48
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version472))
+ <> null
+ then
+ Net472
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version471))
+ <> null
+ then
+ Net471
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version47))
+ <> null
+ then
+ Net47
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version462))
+ <> null
+ then
+ Net462
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version461))
+ <> null
+ then
+ Net461
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version461))
+ <> null
+ then
+ Net461
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version46))
+ <> null
+ then
+ Net46
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version452))
+ <> null
+ then
+ Net452
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451))
+ <> null
+ then
+ Net451
+ elif
+ box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version45))
+ <> null
+ then
+ Net45
+ else
+ Net45 // version is 4.5 assumed since this code is running.
+ with _ ->
+ Net45
+
+ // 1. First look to see if we can find the highest installed set of dotnet reference assemblies, if yes then select that framework
+ // 2. Otherwise ask msbuild for the highestinstalled framework
+ let checkFrameworkForReferenceAssemblies (dotNetVersion: string) =
+ if not (String.IsNullOrEmpty(dotNetVersion)) then
+ try
+ let v =
+ if dotNetVersion.StartsWith("v") then
+ dotNetVersion.Substring(1)
+ else
+ dotNetVersion
+
+ let frameworkName =
+ System.Runtime.Versioning.FrameworkName(".NETFramework", Version(v))
+
+ match ToolLocationHelper.GetPathToReferenceAssemblies(frameworkName) |> Seq.tryHead with
+ | Some p -> FileSystem.DirectoryExistsShim(p)
+ | None -> false
+ with _ ->
+ false
+ else
+ false
+
+ match
+ SupportedDesktopFrameworkVersions
+ |> Seq.tryFind (fun v -> checkFrameworkForReferenceAssemblies v)
+ with
+ | Some v -> v
+ | None -> getHighestInstalledDotNETFramework ()
+
+/// Derive the target framework directories.
+let DeriveTargetFrameworkDirectories (targetFrameworkVersion: string, logMessage) =
+
+ let targetFrameworkVersion =
+ if not (targetFrameworkVersion.StartsWith("v", StringComparison.Ordinal)) then
+ "v" + targetFrameworkVersion
+ else
+ targetFrameworkVersion
+
+ let result =
+ GetPathToDotNetFrameworkReferenceAssemblies(targetFrameworkVersion)
+ |> Array.ofList
+
+ logMessage (sprintf "Derived target framework directories for version %s are: %s" targetFrameworkVersion (String.Join(",", result)))
+ result
+
+/// Describes the location where the reference was found, used only for debug and tooltip output
+type ResolvedFrom =
+ | AssemblyFolders
+ | AssemblyFoldersEx
+ | TargetFrameworkDirectory
+ | RawFileName
+ | GlobalAssemblyCache
+ | Path of string
+ | Unknown
+
+/// Decode the ResolvedFrom code from MSBuild.
+let DecodeResolvedFrom (resolvedFrom: string) : ResolvedFrom =
+ match resolvedFrom with
+ | "{RawFileName}" -> RawFileName
+ | "{GAC}" -> GlobalAssemblyCache
+ | "{TargetFrameworkDirectory}" -> TargetFrameworkDirectory
+ | "{AssemblyFolders}" -> AssemblyFolders
+ | r when r.Length >= 10 && "{Registry:" = r.Substring(0, 10) -> AssemblyFoldersEx
+ | r -> ResolvedFrom.Path r
+
+let TooltipForResolvedFrom (resolvedFrom, fusionName, redist) =
+ fun (originalReference, resolvedPath) ->
+ let originalReferenceName = originalReference
+
+ let resolvedPath = // Don't show the resolved path if it is identical to what was referenced.
+ if originalReferenceName = resolvedPath then
+ String.Empty
+ else
+ resolvedPath
+
+ let lineIfExists text =
+ if String.IsNullOrEmpty text then
+ ""
+ else
+ text.Trim(' ') + "\n"
+
+ match resolvedFrom with
+ | AssemblyFolders ->
+ lineIfExists resolvedPath
+ + lineIfExists fusionName
+ + LegacyResolver.SR.assemblyResolutionFoundByAssemblyFoldersKey ()
+ | AssemblyFoldersEx ->
+ lineIfExists resolvedPath
+ + lineIfExists fusionName
+ + LegacyResolver.SR.assemblyResolutionFoundByAssemblyFoldersExKey ()
+ | TargetFrameworkDirectory ->
+ lineIfExists resolvedPath
+ + lineIfExists fusionName
+ + LegacyResolver.SR.assemblyResolutionNetFramework ()
+ | Unknown ->
+ // Unknown when resolved by plain directory search without help from MSBuild resolver.
+ lineIfExists resolvedPath + lineIfExists fusionName
+ | RawFileName -> lineIfExists fusionName
+ | GlobalAssemblyCache ->
+ lineIfExists fusionName
+ + lineIfExists (LegacyResolver.SR.assemblyResolutionGAC ())
+ + lineIfExists redist
+ | Path _ -> lineIfExists resolvedPath + lineIfExists fusionName
+
+/// Perform assembly resolution by instantiating the ResolveAssembly task directly from the MSBuild SDK.
+let ResolveCore
+ (
+ resolutionEnvironment: LegacyResolutionEnvironment,
+ references: (string * string)[],
+ targetFrameworkVersion: string,
+ targetFrameworkDirectories: string list,
+ targetProcessorArchitecture: string,
+ fsharpCoreDir: string,
+ explicitIncludeDirs: string list,
+ implicitIncludeDir: string,
+ allowRawFileName: bool,
+ logMessage: string -> unit,
+ logDiagnostic: bool -> string -> string -> unit
+ ) =
+
+ let frameworkRegistryBase, assemblyFoldersSuffix, assemblyFoldersConditions =
+ "Software\Microsoft\.NetFramework", "AssemblyFoldersEx", ""
+
+ if Array.isEmpty references then
+ [||]
+ else
+
+ let mutable backgroundException = false
+
+ let protect f =
+ if not backgroundException then
+ try
+ f ()
+ with _ ->
+ backgroundException <- true
+
+ let engine =
+ { new IBuildEngine with
+ member _.BuildProjectFile(projectFileName, targetNames, globalProperties, targetOutputs) = true
+
+ member _.LogCustomEvent(e) =
+ protect (fun () -> logMessage e.Message)
+
+ member _.LogErrorEvent(e) =
+ protect (fun () -> logDiagnostic true e.Code e.Message)
+
+ member _.LogMessageEvent(e) =
+ protect (fun () -> logMessage e.Message)
+
+ member _.LogWarningEvent(e) =
+ protect (fun () -> logDiagnostic false e.Code e.Message)
+
+ member _.ColumnNumberOfTaskNode = 1
+ member _.LineNumberOfTaskNode = 1
+ member _.ContinueOnError = true
+ member _.ProjectFileOfTaskNode = ""
+ }
+
+ // Derive the target framework directory if none was supplied.
+ let targetFrameworkDirectories =
+ if targetFrameworkDirectories = [] then
+ DeriveTargetFrameworkDirectories(targetFrameworkVersion, logMessage)
+ else
+ targetFrameworkDirectories |> Array.ofList
+
+ // Filter for null and zero length
+ let references = references |> Array.filter (fst >> String.IsNullOrEmpty >> not)
+
+ // Determine the set of search paths for the resolution
+ let searchPaths =
+
+ let explicitIncludeDirs =
+ explicitIncludeDirs |> List.filter (String.IsNullOrEmpty >> not)
+
+ let registry =
+ sprintf "{Registry:%s,%s,%s%s}" frameworkRegistryBase targetFrameworkVersion assemblyFoldersSuffix assemblyFoldersConditions
+
+ [| // When compiling scripts using fsc.exe, for some reason we have always historically put TargetFrameworkDirectory first
+ // It is unclear why. This is the only place we look at the 'isdifference between ResolutionEnvironment.EditingOrCompilation and ResolutionEnvironment.EditingTime.
+ match resolutionEnvironment with
+ | LegacyResolutionEnvironment.EditingOrCompilation false -> yield "{TargetFrameworkDirectory}"
+ | LegacyResolutionEnvironment.EditingOrCompilation true
+ | LegacyResolutionEnvironment.CompilationAndEvaluation -> ()
+
+ // Quick-resolve straight to file name first
+ if allowRawFileName then
+ yield "{RawFileName}"
+ yield! explicitIncludeDirs // From -I, #I
+ yield fsharpCoreDir // Location of explicit reference to FSharp.Core, otherwise location of fsc.exe
+ yield implicitIncludeDir // Usually the project directory
+
+ match resolutionEnvironment with
+ | LegacyResolutionEnvironment.EditingOrCompilation true
+ | LegacyResolutionEnvironment.CompilationAndEvaluation -> yield "{TargetFrameworkDirectory}"
+ | LegacyResolutionEnvironment.EditingOrCompilation false -> ()
+
+ yield registry
+ yield "{AssemblyFolders}"
+ yield "{GAC}"
+ // use path to implementation assemblies as the last resort
+ yield! GetPathToDotNetFrameworkImlpementationAssemblies targetFrameworkVersion
+ |]
+
+ let assemblies =
+ [|
+ for referenceName, baggage in references ->
+ let item = TaskItem(referenceName) :> ITaskItem
+ item.SetMetadata("Baggage", baggage)
+ item
+ |]
+
+ let rar =
+ ResolveAssemblyReference(
+ BuildEngine = engine,
+ TargetFrameworkDirectories = targetFrameworkDirectories,
+ FindRelatedFiles = false,
+ FindDependencies = false,
+ FindSatellites = false,
+ FindSerializationAssemblies = false,
+ Assemblies = assemblies,
+ SearchPaths = searchPaths,
+ AllowedAssemblyExtensions = [| ".dll"; ".exe" |]
+ )
+
+ rar.TargetProcessorArchitecture <- targetProcessorArchitecture
+ let targetedRuntimeVersionValue = typeof.Assembly.ImageRuntimeVersion
+ rar.TargetedRuntimeVersion <- targetedRuntimeVersionValue
+ rar.CopyLocalDependenciesWhenParentReferenceInGac <- true
+
+ let succeeded = rar.Execute()
+
+ if not succeeded then
+ raise LegacyResolutionFailure
+
+ [|
+ for p in rar.ResolvedFiles ->
+ let resolvedFrom = DecodeResolvedFrom(p.GetMetadata("ResolvedFrom"))
+ let fusionName = p.GetMetadata("FusionName")
+ let redist = p.GetMetadata("Redist")
+
+ {
+ itemSpec = p.ItemSpec
+ prepareToolTip = TooltipForResolvedFrom(resolvedFrom, fusionName, redist)
+ baggage = p.GetMetadata("Baggage")
+ }
+ |]
+
+let getResolver () =
+ { new ILegacyReferenceResolver with
+ member _.HighestInstalledNetFrameworkVersion() =
+ HighestInstalledRefAssembliesOrDotNETFramework()
+
+ member _.DotNetFrameworkReferenceAssembliesRootDirectory =
+ DotNetFrameworkReferenceAssembliesRootDirectory
+
+ /// Perform the resolution on rooted and unrooted paths, and then combine the results.
+ member _.Resolve
+ (
+ resolutionEnvironment,
+ references,
+ targetFrameworkVersion,
+ targetFrameworkDirectories,
+ targetProcessorArchitecture,
+ fsharpCoreDir,
+ explicitIncludeDirs,
+ implicitIncludeDir,
+ logMessage,
+ logDiagnostic
+ ) =
+
+ // The {RawFileName} target is 'dangerous', in the sense that is uses Directory.GetCurrentDirectory() to resolve unrooted file paths.
+ // It is unreliable to use this mutable global state inside Visual Studio. As a result, we partition all references into a "rooted" set
+ // (which contains e.g. C:\MyDir\MyAssem.dll) and "unrooted" (everything else). We only allow "rooted" to use {RawFileName}. Note that
+ // unrooted may still find 'local' assemblies by virtue of the fact that "implicitIncludeDir" is one of the places searched during
+ // assembly resolution.
+ let references =
+ [|
+ for fileName, baggage as data in references ->
+ // However, MSBuild will not resolve 'relative' paths, even when e.g. implicitIncludeDir is part of the search. As a result,
+ // if we have an unrooted path + file name, we'll assume this is relative to the project directory and root it.
+ if FileSystem.IsPathRootedShim(fileName) then
+ data // fine, e.g. "C:\Dir\foo.dll"
+ elif not (fileName.Contains("\\") || fileName.Contains("/")) then
+ data // fine, e.g. "System.Transactions.dll"
+ else
+ // We have a 'relative path', e.g. "bin/Debug/foo.exe" or "..\Yadda\bar.dll"
+ // turn it into an absolute path based at implicitIncludeDir
+ (Path.Combine(implicitIncludeDir, fileName), baggage)
+ |]
+
+ let rooted, unrooted =
+ references |> Array.partition (fst >> FileSystem.IsPathRootedShim)
+
+ let rootedResults =
+ ResolveCore(
+ resolutionEnvironment,
+ rooted,
+ targetFrameworkVersion,
+ targetFrameworkDirectories,
+ targetProcessorArchitecture,
+ fsharpCoreDir,
+ explicitIncludeDirs,
+ implicitIncludeDir,
+ true,
+ logMessage,
+ logDiagnostic
+ )
+
+ let unrootedResults =
+ ResolveCore(
+ resolutionEnvironment,
+ unrooted,
+ targetFrameworkVersion,
+ targetFrameworkDirectories,
+ targetProcessorArchitecture,
+ fsharpCoreDir,
+ explicitIncludeDirs,
+ implicitIncludeDir,
+ false,
+ logMessage,
+ logDiagnostic
+ )
+
+ // now unify the two sets of results
+ Array.concat [| rootedResults; unrootedResults |]
+ }
+ |> LegacyReferenceResolver
diff --git a/src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fsi b/src/LegacyMSBuildResolver/LegacyMSBuildReferenceResolver.fsi
similarity index 100%
rename from src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fsi
rename to src/LegacyMSBuildResolver/LegacyMSBuildReferenceResolver.fsi
diff --git a/src/LegacyMSBuildResolver/LegacyResolver.txt b/src/LegacyMSBuildResolver/LegacyResolver.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1aac6347541b65bcf28a9e86ff136a686910d141
--- /dev/null
+++ b/src/LegacyMSBuildResolver/LegacyResolver.txt
@@ -0,0 +1,7 @@
+# -------------------------------------------------------------------------------
+# use a completely new error number and keep messages in their surrounding groups
+# -------------------------------------------------------------------------------
+assemblyResolutionFoundByAssemblyFoldersKey,"Found by AssemblyFolders registry key"
+assemblyResolutionFoundByAssemblyFoldersExKey,"Found by AssemblyFoldersEx registry key"
+assemblyResolutionNetFramework,".NET Framework"
+assemblyResolutionGAC,"Global Assembly Cache"
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.cs.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.cs.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..fe16dc84f65beab6dfcfc884970a3b907cd96d5a
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.cs.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.de.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.de.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..0980cec838a62979dd11bba6ebcd6a2678a98bef
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.de.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.es.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.es.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..ae938d2cacdcfef29256c2a12f435e6526bee228
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.es.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.fr.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.fr.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..7fe414772307482b12d11a4c6c47902431f111df
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.fr.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.it.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.it.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..d20390cc87ec138656ad73b499dabf08110e6765
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.it.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ja.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ja.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..2f2fbca84a336f514736a0b7d99f4b2c8ec4b25e
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ja.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ko.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ko.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..a57ff6c0dc3e36256e899d6977ba305b4e14b44e
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ko.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pl.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pl.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..49133a8479cf4f21bc78c3902e31460cf4d39394
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pl.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pt-BR.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pt-BR.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..fbfa95dbf16ef088f91abe4ac684851e17ca9c57
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pt-BR.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ru.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ru.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..c01f76a72968f157212f3d25e485bf6f7aed30cb
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ru.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.tr.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.tr.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..3131d7674af6bbc823c58fec323765ec05a6fb4b
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.tr.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hans.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hans.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..7791accdff9c137c97d20d2ac058d7e39f4631bd
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hans.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hant.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hant.xlf
new file mode 100644
index 0000000000000000000000000000000000000000..52a305821cf5367ce59870a99341ea94a03dd380
--- /dev/null
+++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hant.xlf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ Found by AssemblyFoldersEx registry key
+
+
+
+
+ Found by AssemblyFolders registry key
+
+
+
+
+ Global Assembly Cache
+
+
+
+
+ .NET Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/src/fsc/fsc.targets b/src/fsc/fsc.targets
index af1998e9bbea9ccc06cc94a2b6f57e6dac853c8f..6dccff1eae306f50fe08e978bfebf7181639dc6e 100644
--- a/src/fsc/fsc.targets
+++ b/src/fsc/fsc.targets
@@ -28,6 +28,11 @@
+
+ LegacyResolver.txt
+
+
+ {{FSCoreVersion}}
@@ -46,6 +51,9 @@
+
+
+
diff --git a/src/fsi/fsi.targets b/src/fsi/fsi.targets
index 23ee6e76bfc0d01e1be27ecc017602fd38eb6de4..e553c55cf1c0ce771383484ca6b0dfa35717862c 100644
--- a/src/fsi/fsi.targets
+++ b/src/fsi/fsi.targets
@@ -32,6 +32,11 @@
+
+ LegacyResolver.txt
+
+
+
@@ -54,4 +59,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
index 52360afde2aabf7ff3cccddb59f97b81ee7d0e6d..5c85f5131fa1a76027d127f5c7f4f0b0460b1fcc 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected
@@ -2191,9 +2191,54 @@ FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet: Boolean Equals(Syste
FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet: Int32 GetHashCode()
FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet: Int32 GetHashCode(System.Collections.IEqualityComparer)
FSharp.Compiler.CodeAnalysis.FSharpUnresolvedReferencesSet: System.String ToString()
-FSharp.Compiler.CodeAnalysis.LegacyMSBuildReferenceResolver
-FSharp.Compiler.CodeAnalysis.LegacyMSBuildReferenceResolver: FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver getResolver()
+FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver
+FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver: FSharp.Compiler.CodeAnalysis.LegacyResolvedFile[] Resolve(FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, System.Tuple`2[System.String,System.String][], System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String], System.String, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String], System.String, Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpFunc`2[System.Boolean,Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Core.FSharpFunc`2[System.String,Microsoft.FSharp.Core.Unit]]])
+FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver: System.String DotNetFrameworkReferenceAssembliesRootDirectory
+FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver: System.String HighestInstalledNetFrameworkVersion()
+FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver: System.String get_DotNetFrameworkReferenceAssembliesRootDirectory()
FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver
+FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver: Void .ctor(FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment+EditingOrCompilation: Boolean get_isEditing()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment+EditingOrCompilation: Boolean isEditing
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment+Tags: Int32 CompilationAndEvaluation
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment+Tags: Int32 EditingOrCompilation
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Boolean Equals(FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Boolean Equals(System.Object)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Boolean Equals(System.Object, System.Collections.IEqualityComparer)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Boolean IsCompilationAndEvaluation
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Boolean IsEditingOrCompilation
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Boolean get_IsCompilationAndEvaluation()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Boolean get_IsEditingOrCompilation()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment CompilationAndEvaluation
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment NewEditingOrCompilation(Boolean)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment get_CompilationAndEvaluation()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment+EditingOrCompilation
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment+Tags
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Int32 CompareTo(FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Int32 CompareTo(System.Object)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Int32 CompareTo(System.Object, System.Collections.IComparer)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Int32 GetHashCode()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Int32 GetHashCode(System.Collections.IEqualityComparer)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Int32 Tag
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: Int32 get_Tag()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment: System.String ToString()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionFailure
+FSharp.Compiler.CodeAnalysis.LegacyResolutionFailure: Boolean Equals(System.Object)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionFailure: Boolean Equals(System.Object, System.Collections.IEqualityComparer)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionFailure: Int32 GetHashCode()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionFailure: Int32 GetHashCode(System.Collections.IEqualityComparer)
+FSharp.Compiler.CodeAnalysis.LegacyResolutionFailure: System.String get_Message()
+FSharp.Compiler.CodeAnalysis.LegacyResolutionFailure: Void .ctor()
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile: Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.String],System.String] get_prepareToolTip()
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile: Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.String],System.String] prepareToolTip
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile: System.String ToString()
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile: System.String baggage
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile: System.String get_baggage()
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile: System.String get_itemSpec()
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile: System.String itemSpec
+FSharp.Compiler.CodeAnalysis.LegacyResolvedFile: Void .ctor(System.String, Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[System.String,System.String],System.String], System.String)
FSharp.Compiler.CompilerEnvironment
FSharp.Compiler.CompilerEnvironment: Boolean IsCheckerSupportedSubcategory(System.String)
FSharp.Compiler.CompilerEnvironment: Boolean IsCompilable(System.String)
diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj
index a697caba11add88ccce2fca161cc507062dbb1d5..e417791c80d12b6ac07d23116198801abcf4e7de 100644
--- a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj
+++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj
@@ -15,6 +15,11 @@
+
+ LegacyResolver.txt
+
+
+
@@ -24,4 +29,10 @@
+
+
+
+
+
+
diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj
index db217723e134545ba54a00b6982aaa4d89222366..d27151bf5e57924b0bfa12e0e7df7e455bc0c3de 100644
--- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj
+++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj
@@ -22,6 +22,11 @@
trueMicrosoft.VisualStudio.FSharp.Editor.SR
+
+ LegacyResolver.txt
+
+
+