From 8074762d7613dc3e15120d2d44d440d4f8a829f8 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sun, 26 Jun 2016 21:18:51 +0200 Subject: [PATCH 1/2] try to fix msbuild reference not found on coreclr. --- src/fsharp/fsi/fsi.fs | 4 ++++ src/utils/reshapedmsbuild.fs | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index a91163f2a8..37cc86d346 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -2383,6 +2383,10 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i true, // long running: optimizeForMemory currentDirectory,isInteractive=true, isInvalidationSupported=false) +#if NETSTANDARD1_5 + do tcConfigB.useMonoResolution <- true + do tcConfigB.primaryAssembly <- PrimaryAssembly.DotNetCore +#endif let tcConfigP = TcConfigProvider.BasedOnMutableBuilder(tcConfigB) #if FX_MSBUILDRESOLVER_RUNTIMELIKE do tcConfigB.resolutionEnvironment <- MSBuildResolver.RuntimeLike // See Bug 3608 diff --git a/src/utils/reshapedmsbuild.fs b/src/utils/reshapedmsbuild.fs index 9fda2ca917..53922c63b3 100644 --- a/src/utils/reshapedmsbuild.fs +++ b/src/utils/reshapedmsbuild.fs @@ -29,7 +29,15 @@ open System.Collections open System.Reflection type TaskItem (itemSpec:string) = - let assembly = Assembly.Load(new AssemblyName("Microsoft.Build.Utilities.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")) + let assembly = + Assembly.Load( + new AssemblyName( +#if !NETSTANDARD1_5 + "Microsoft.Build.Utilities.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +#else + "Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +#endif + )) let buildUtilitiesTaskType = assembly.GetType("Microsoft.Build.Utilities.Task") let instance = Activator.CreateInstance(buildUtilitiesTaskType, [|itemSpec|]) @@ -784,7 +792,15 @@ module internal ToolLocationHelper = // instance.GetType().GetPropserty(propName, BindingFlags.Public).SetValue(instance, propValue, null) type ResolveAssemblyReference () = - let assembly = Assembly.Load(new AssemblyName("Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")) + let assembly = + Assembly.Load( + new AssemblyName( +#if !NETSTANDARD1_5 + "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +#else + "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +#endif + )) let resolveAssemblyReferenceType = assembly.GetType("Microsoft.Build.Tasks.ResolveAssemblyReference") let instance = Activator.CreateInstance(resolveAssemblyReferenceType) From de01a0fa528fbc2097e378e97c3f6cee3da9816e Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Mon, 27 Jun 2016 00:05:27 +0200 Subject: [PATCH 2/2] ignore seqpoint on coreclr --- src/absil/ilreflect.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 6593025da4..03c97b67f9 100755 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -1180,6 +1180,7 @@ let rec emitInstr cenv (modB : ModuleBuilder) emEnv (ilG:ILGenerator) instr = | I_rethrow -> ilG.EmitAndLog(OpCodes.Rethrow) | I_break -> ilG.EmitAndLog(OpCodes.Break) #if FX_RESHAPED_REFEMIT + | I_seqpoint _ -> () #else | I_seqpoint src -> if cenv.generatePdb && not (src.Document.File.EndsWith("stdin",StringComparison.Ordinal)) then