From b0cac23f04f4f6c7ff1e2dfa3994b1acfc7180f5 Mon Sep 17 00:00:00 2001 From: ncave Date: Mon, 20 Jun 2016 13:46:27 -0700 Subject: [PATCH] Added default script references for .NET Core --- src/fsharp/CompileOps.fs | 21 +++++++++++++++++++++ src/fsharp/vs/IncrementalBuild.fs | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 8f3726fd76..49c11ad003 100755 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -1585,6 +1585,25 @@ let GetFsiLibraryName () = "FSharp.Compiler.Interactive.Settings" // (b) included in environment for files 'orphaned' from a project context // -- for orphaned files (files in VS without a project context) // -- for files given on a command line without --noframework set +#if TODO_REWORK_ASSEMBLY_LOAD + +// .NET Core references +let DefaultBasicReferencesForOutOfProjectSources = + [ yield typeof.Assembly.Location; // mscorlib + yield typeof.Assembly.Location; // System.Console + yield typeof.Assembly.Location; // System.Runtime + yield typeof.Assembly.Location; // System.ObjectModel + yield typeof.Assembly.Location; // System.IO + yield typeof.Assembly.Location; // System.Linq + yield typeof.Assembly.Location; // System.Xml.Linq + yield typeof.Assembly.Location; // System.Net.Requests + yield typeof.Assembly.Location; // System.Runtime.Numerics + yield typeof.Assembly.Location; // System.Threading.Tasks + yield typeof.Assembly.Location; // FSharp.Core + ] +let DefaultBasicReferencesForOutOfProjectSources40 = [] + +#else let DefaultBasicReferencesForOutOfProjectSources = [ yield "System" yield "System.Xml" @@ -1618,6 +1637,8 @@ let DefaultBasicReferencesForOutOfProjectSources = // Extra implicit references for .NET 4.0 let DefaultBasicReferencesForOutOfProjectSources40 = [ "System.Numerics" ] + +#endif // A set of assemblies to always consider to be system assemblies let SystemAssemblies primaryAssemblyName = diff --git a/src/fsharp/vs/IncrementalBuild.fs b/src/fsharp/vs/IncrementalBuild.fs index 7a82d3ffaa..eea23b29ac 100755 --- a/src/fsharp/vs/IncrementalBuild.fs +++ b/src/fsharp/vs/IncrementalBuild.fs @@ -1787,7 +1787,9 @@ type IncrementalBuilder(frameworkTcImportsCache: FrameworkImportsCache, tcConfig define::tcConfigB.conditionalCompilationDefines tcConfigB.projectReferences <- projectReferences - +#if TODO_REWORK_ASSEMBLY_LOAD + tcConfigB.useMonoResolution <- true // turn off msbuild resolution +#endif // Apply command-line arguments and collect more source files if they are in the arguments let sourceFilesNew = try