Skip to content

Commit b0cac23

Browse files
committed
Added default script references for .NET Core
1 parent e59524b commit b0cac23

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/fsharp/CompileOps.fs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,25 @@ let GetFsiLibraryName () = "FSharp.Compiler.Interactive.Settings"
15851585
// (b) included in environment for files 'orphaned' from a project context
15861586
// -- for orphaned files (files in VS without a project context)
15871587
// -- for files given on a command line without --noframework set
1588+
#if TODO_REWORK_ASSEMBLY_LOAD
1589+
1590+
// .NET Core references
1591+
let DefaultBasicReferencesForOutOfProjectSources =
1592+
[ yield typeof<System.Object>.Assembly.Location; // mscorlib
1593+
yield typeof<System.Console>.Assembly.Location; // System.Console
1594+
yield typeof<System.ComponentModel.DefaultValueAttribute>.Assembly.Location; // System.Runtime
1595+
yield typeof<System.ComponentModel.PropertyChangedEventArgs>.Assembly.Location; // System.ObjectModel
1596+
yield typeof<System.IO.BufferedStream>.Assembly.Location; // System.IO
1597+
yield typeof<System.Linq.Enumerable>.Assembly.Location; // System.Linq
1598+
yield typeof<System.Xml.Linq.XDocument>.Assembly.Location; // System.Xml.Linq
1599+
yield typeof<System.Net.WebRequest>.Assembly.Location; // System.Net.Requests
1600+
yield typeof<System.Numerics.BigInteger>.Assembly.Location; // System.Runtime.Numerics
1601+
yield typeof<System.Threading.Tasks.TaskExtensions>.Assembly.Location; // System.Threading.Tasks
1602+
yield typeof<Microsoft.FSharp.Core.MeasureAttribute>.Assembly.Location; // FSharp.Core
1603+
]
1604+
let DefaultBasicReferencesForOutOfProjectSources40 = []
1605+
1606+
#else
15881607
let DefaultBasicReferencesForOutOfProjectSources =
15891608
[ yield "System"
15901609
yield "System.Xml"
@@ -1618,6 +1637,8 @@ let DefaultBasicReferencesForOutOfProjectSources =
16181637
// Extra implicit references for .NET 4.0
16191638
let DefaultBasicReferencesForOutOfProjectSources40 =
16201639
[ "System.Numerics" ]
1640+
1641+
#endif
16211642

16221643
// A set of assemblies to always consider to be system assemblies
16231644
let SystemAssemblies primaryAssemblyName =

src/fsharp/vs/IncrementalBuild.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,9 @@ type IncrementalBuilder(frameworkTcImportsCache: FrameworkImportsCache, tcConfig
17871787
define::tcConfigB.conditionalCompilationDefines
17881788

17891789
tcConfigB.projectReferences <- projectReferences
1790-
1790+
#if TODO_REWORK_ASSEMBLY_LOAD
1791+
tcConfigB.useMonoResolution <- true // turn off msbuild resolution
1792+
#endif
17911793
// Apply command-line arguments and collect more source files if they are in the arguments
17921794
let sourceFilesNew =
17931795
try

0 commit comments

Comments
 (0)