Bug 55626

Summary: FSharp.NET.Sdk bundled with mono should not override FscToolPath and FscToolExe properties
Product: [Mono] Tools Reporter: Enrico Sada <enrico>
Component: msbuildAssignee: Jason Imison <jason.imison>
Status: RESOLVED FIXED    
Severity: normal CC: jason.imison, matt.ward, mono-bugs+mono, mono-bugs+tools, v-rosman
Priority: ---    
Version: 5.0 (2017-02)   
Target Milestone: 15.2   
Hardware: Other   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description Enrico Sada 2017-04-26 15:20:23 UTC
With current mono 5.0.0 alpha, the `FSharp.NET.Sdk` bundled override `FscToolPath` and `FscToolExe` in
the msbuild target file `/usr/lib/mono/msbuild/15.0/bin/Sdks/FSharp.NET.Sdk/Sdk/Sdk.targets`

```
    <!-- Set this here, because FscTool* properties get unconditionally set
         in the Sdk, so we want to override them -->
    <FscToolExe>fsc.exe</FscToolExe>
    <FscToolPath>$(MSBuildToolsPath)\..\..\..\fsharp</FscToolPath>
```

With FSharp.NET.Sdk version 1.0.3 (ref https://github.com/dotnet/netcorecli-fsc/releases/tag/v1.0.3), that's not needed anymore, and doing so make new fsproj not build correctly

# Repro

```
dotnet new console -lang f#
msbuild /t:Restore
msbuild /t:Build /v:n
```

## Expected

successful build

## Actual

build fails because it use overriden fsc path, isntead the one from `FSharp.Compiler.Tools` (referenced by `FSharp.NET.Sdk`)



Woraround:

Comment or remove the lines from `/usr/lib/mono/msbuild/15.0/bin/Sdks/FSharp.NET.Sdk/Sdk/Sdk.targets`

# Environment

```
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty
```


`mono --version`

```
Mono JIT compiler version 5.0.0 (Stable 5.0.0.61/4242008 Wed Apr 19 17:00:56 UTC 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen (concurrent by default)
```
Comment 1 Jason Imison 2017-04-27 08:17:22 UTC
It's building fine with mono 5.0.0.66 and above

✔ ~/src/bug55626
09:11 $ msbuild /t:Restore
Microsoft (R) Build Engine version 15.2.0.0 (xplat-2017-02/20b9fb5 Fri Apr 21 18:29:38 EDT 2017)
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 4/27/2017 9:11:42 AM.
Project "/Users/jason/src/bug55626/bug55626.fsproj" on node 1 (Restore target(s)).
Restore:
  Restoring packages for /Users/jason/src/bug55626/bug55626.fsproj...
    GET https://dotnetmyget.blob.core.windows.net/artifacts/dotnet-core/nuget/v3/flatcontainer/fsharp.core/index.json
    GET https://www.nuget.org/api/v2/FindPackagesById()?id='FSharp.Core'
    GET https://www.myget.org/F/xamarin-internal/auth/08bb9531-0ad8-40c5-ac0e-8618b863d416/api/v2/FindPackagesById()?id='FSharp.Core'
    GET https://dotnetmyget.blob.core.windows.net/artifacts/dotnet-core/nuget/v3/flatcontainer/fsharp.net.sdk/index.json
    GET https://www.nuget.org/api/v2/FindPackagesById()?id='FSharp.NET.Sdk'
    GET https://www.myget.org/F/xamarin-internal/auth/08bb9531-0ad8-40c5-ac0e-8618b863d416/api/v2/FindPackagesById()?id='FSharp.NET.Sdk'
    OK https://www.myget.org/F/xamarin-internal/auth/08bb9531-0ad8-40c5-ac0e-8618b863d416/api/v2/FindPackagesById()?id='FSharp.Core' 967ms
    OK https://www.nuget.org/api/v2/FindPackagesById()?id='FSharp.Core' 1037ms
    OK https://www.myget.org/F/xamarin-internal/auth/08bb9531-0ad8-40c5-ac0e-8618b863d416/api/v2/FindPackagesById()?id='FSharp.NET.Sdk' 1026ms
    GET https://www.nuget.org/api/v2/package/FSharp.Core/4.1.12
    NotFound https://dotnetmyget.blob.core.windows.net/artifacts/dotnet-core/nuget/v3/flatcontainer/fsharp.core/index.json 1188ms
    OK https://www.nuget.org/api/v2/FindPackagesById()?id='FSharp.NET.Sdk' 1169ms
    GET https://www.nuget.org/api/v2/package/FSharp.NET.Sdk/1.0.3
    NotFound https://dotnetmyget.blob.core.windows.net/artifacts/dotnet-core/nuget/v3/flatcontainer/fsharp.net.sdk/index.json 1263ms
    OK https://www.nuget.org/api/v2/package/FSharp.Core/4.1.12 373ms
    OK https://www.nuget.org/api/v2/package/FSharp.NET.Sdk/1.0.3 7882ms
  Committing restore...
  Generating MSBuild file /Users/jason/src/bug55626/obj/bug55626.fsproj.nuget.g.props.
  Generating MSBuild file /Users/jason/src/bug55626/obj/bug55626.fsproj.nuget.g.targets.
  Writing lock file to disk. Path: /Users/jason/src/bug55626/obj/project.assets.json
  Restore completed in 13.12 sec for /Users/jason/src/bug55626/bug55626.fsproj.

  NuGet Config files used:
      /Users/jason/nuget.config
      /Users/jason/.config/NuGet/NuGet.Config

  Feeds used:
      https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
      /Users/jason/src/Xamarin.Android.FSharp.ResourceProvider
      https://www.nuget.org/api/v2/
      https://www.myget.org/F/xamarin-internal/auth/08bb9531-0ad8-40c5-ac0e-8618b863d416/api/v2
Done Building Project "/Users/jason/src/bug55626/bug55626.fsproj" (Restore target(s)).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:14.53
✔ ~/src/bug55626
09:11 $ msbuild /t:Build /v:n
Microsoft (R) Build Engine version 15.2.0.0 (xplat-2017-02/20b9fb5 Fri Apr 21 18:29:38 EDT 2017)
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 4/27/2017 9:11:59 AM.
Project "/Users/jason/src/bug55626/bug55626.fsproj" on node 1 (Build target(s)).
PrepareForBuild:
  Creating directory "bin/Debug/netcoreapp1.1/".
  Creating directory "obj/Debug/netcoreapp1.1/".
CoreCompile:
  /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/msbuild/15.0/bin/../../../fsharp/fsc.exe -o:obj/Debug/netcoreapp1.1/bug55626.dll
  -g
  --debug:portable
  --noframework
  --define:DEBUG
  --define:NETCOREAPP1_1
  --optimize-
  -r:/Users/jason/.nuget/packages/fsharp.core/4.1.12/lib/netstandard1.6/FSharp.Core.dll
  -r:/Users/jason/.nuget/packages/microsoft.csharp/4.3.0/ref/netstandard1.0/Microsoft.CSharp.dll
  -r:/Users/jason/.nuget/packages/microsoft.visualbasic/10.1.0/ref/netstandard1.1/Microsoft.VisualBasic.dll
  -r:/Users/jason/.nuget/packages/microsoft.win32.primitives/4.3.0/ref/netstandard1.3/Microsoft.Win32.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.appcontext/4.3.0/ref/netstandard1.6/System.AppContext.dll
  -r:/Users/jason/.nuget/packages/system.buffers/4.3.0/lib/netstandard1.1/System.Buffers.dll
  -r:/Users/jason/.nuget/packages/system.collections.concurrent/4.3.0/ref/netstandard1.3/System.Collections.Concurrent.dll
  -r:/Users/jason/.nuget/packages/system.collections/4.3.0/ref/netstandard1.3/System.Collections.dll
  -r:/Users/jason/.nuget/packages/system.collections.immutable/1.3.0/lib/netstandard1.0/System.Collections.Immutable.dll
  -r:/Users/jason/.nuget/packages/system.componentmodel.annotations/4.3.0/ref/netstandard1.4/System.ComponentModel.Annotations.dll
  -r:/Users/jason/.nuget/packages/system.componentmodel/4.3.0/ref/netstandard1.0/System.ComponentModel.dll
  -r:/Users/jason/.nuget/packages/system.console/4.3.0/ref/netstandard1.3/System.Console.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.debug/4.3.0/ref/netstandard1.3/System.Diagnostics.Debug.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.diagnosticsource/4.3.0/lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.process/4.3.0/ref/netstandard1.4/System.Diagnostics.Process.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.tools/4.3.0/ref/netstandard1.0/System.Diagnostics.Tools.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.tracing/4.3.0/ref/netstandard1.5/System.Diagnostics.Tracing.dll
  -r:/Users/jason/.nuget/packages/system.dynamic.runtime/4.3.0/ref/netstandard1.3/System.Dynamic.Runtime.dll
  -r:/Users/jason/.nuget/packages/system.globalization.calendars/4.3.0/ref/netstandard1.3/System.Globalization.Calendars.dll
  -r:/Users/jason/.nuget/packages/system.globalization/4.3.0/ref/netstandard1.3/System.Globalization.dll
  -r:/Users/jason/.nuget/packages/system.globalization.extensions/4.3.0/ref/netstandard1.3/System.Globalization.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.io.compression/4.3.0/ref/netstandard1.3/System.IO.Compression.dll
  -r:/Users/jason/.nuget/packages/system.io.compression.zipfile/4.3.0/ref/netstandard1.3/System.IO.Compression.ZipFile.dll
  -r:/Users/jason/.nuget/packages/system.io/4.3.0/ref/netstandard1.5/System.IO.dll
  -r:/Users/jason/.nuget/packages/system.io.filesystem/4.3.0/ref/netstandard1.3/System.IO.FileSystem.dll
  -r:/Users/jason/.nuget/packages/system.io.filesystem.primitives/4.3.0/ref/netstandard1.3/System.IO.FileSystem.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.io.filesystem.watcher/4.3.0/ref/netstandard1.3/System.IO.FileSystem.Watcher.dll
  -r:/Users/jason/.nuget/packages/system.io.memorymappedfiles/4.3.0/ref/netstandard1.3/System.IO.MemoryMappedFiles.dll
  -r:/Users/jason/.nuget/packages/system.io.unmanagedmemorystream/4.3.0/ref/netstandard1.3/System.IO.UnmanagedMemoryStream.dll
  -r:/Users/jason/.nuget/packages/system.linq/4.3.0/ref/netstandard1.6/System.Linq.dll
  -r:/Users/jason/.nuget/packages/system.linq.expressions/4.3.0/ref/netstandard1.6/System.Linq.Expressions.dll
  -r:/Users/jason/.nuget/packages/system.linq.parallel/4.3.0/ref/netstandard1.1/System.Linq.Parallel.dll
  -r:/Users/jason/.nuget/packages/system.linq.queryable/4.3.0/ref/netstandard1.0/System.Linq.Queryable.dll
  -r:/Users/jason/.nuget/packages/system.net.http/4.3.0/ref/netstandard1.3/System.Net.Http.dll
  -r:/Users/jason/.nuget/packages/system.net.nameresolution/4.3.0/ref/netstandard1.3/System.Net.NameResolution.dll
  -r:/Users/jason/.nuget/packages/system.net.primitives/4.3.0/ref/netstandard1.3/System.Net.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.net.requests/4.3.0/ref/netstandard1.3/System.Net.Requests.dll
  -r:/Users/jason/.nuget/packages/system.net.security/4.3.0/ref/netstandard1.3/System.Net.Security.dll
  -r:/Users/jason/.nuget/packages/system.net.sockets/4.3.0/ref/netstandard1.3/System.Net.Sockets.dll
  -r:/Users/jason/.nuget/packages/system.net.webheadercollection/4.3.0/ref/netstandard1.3/System.Net.WebHeaderCollection.dll
  -r:/Users/jason/.nuget/packages/system.numerics.vectors/4.3.0/ref/netstandard1.0/System.Numerics.Vectors.dll
  -r:/Users/jason/.nuget/packages/system.objectmodel/4.3.0/ref/netstandard1.3/System.ObjectModel.dll
  -r:/Users/jason/.nuget/packages/system.reflection.dispatchproxy/4.3.0/ref/netstandard1.3/System.Reflection.DispatchProxy.dll
  -r:/Users/jason/.nuget/packages/system.reflection/4.3.0/ref/netstandard1.5/System.Reflection.dll
  -r:/Users/jason/.nuget/packages/system.reflection.extensions/4.3.0/ref/netstandard1.0/System.Reflection.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.reflection.metadata/1.4.1/lib/netstandard1.1/System.Reflection.Metadata.dll
  -r:/Users/jason/.nuget/packages/system.reflection.primitives/4.3.0/ref/netstandard1.0/System.Reflection.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.reflection.typeextensions/4.3.0/ref/netstandard1.5/System.Reflection.TypeExtensions.dll
  -r:/Users/jason/.nuget/packages/system.resources.reader/4.3.0/lib/netstandard1.0/System.Resources.Reader.dll
  -r:/Users/jason/.nuget/packages/system.resources.resourcemanager/4.3.0/ref/netstandard1.0/System.Resources.ResourceManager.dll
  -r:/Users/jason/.nuget/packages/system.runtime/4.3.0/ref/netstandard1.5/System.Runtime.dll
  -r:/Users/jason/.nuget/packages/system.runtime.extensions/4.3.0/ref/netstandard1.5/System.Runtime.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.runtime.handles/4.3.0/ref/netstandard1.3/System.Runtime.Handles.dll
  -r:/Users/jason/.nuget/packages/system.runtime.interopservices/4.3.0/ref/netcoreapp1.1/System.Runtime.InteropServices.dll
  -r:/Users/jason/.nuget/packages/system.runtime.interopservices.runtimeinformation/4.3.0/ref/netstandard1.1/System.Runtime.InteropServices.RuntimeInformation.dll
  -r:/Users/jason/.nuget/packages/system.runtime.numerics/4.3.0/ref/netstandard1.1/System.Runtime.Numerics.dll
  -r:/Users/jason/.nuget/packages/system.security.cryptography.algorithms/4.3.0/ref/netstandard1.6/System.Security.Cryptography.Algorithms.dll
  -r:/Users/jason/.nuget/packages/system.security.cryptography.encoding/4.3.0/ref/netstandard1.3/System.Security.Cryptography.Encoding.dll
  -r:/Users/jason/.nuget/packages/system.security.cryptography.primitives/4.3.0/ref/netstandard1.3/System.Security.Cryptography.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.security.cryptography.x509certificates/4.3.0/ref/netstandard1.4/System.Security.Cryptography.X509Certificates.dll
  -r:/Users/jason/.nuget/packages/system.security.principal/4.3.0/ref/netstandard1.0/System.Security.Principal.dll
  -r:/Users/jason/.nuget/packages/system.text.encoding/4.3.0/ref/netstandard1.3/System.Text.Encoding.dll
  -r:/Users/jason/.nuget/packages/system.text.encoding.extensions/4.3.0/ref/netstandard1.3/System.Text.Encoding.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.text.regularexpressions/4.3.0/ref/netcoreapp1.1/System.Text.RegularExpressions.dll
  -r:/Users/jason/.nuget/packages/system.threading/4.3.0/ref/netstandard1.3/System.Threading.dll
  -r:/Users/jason/.nuget/packages/system.threading.tasks.dataflow/4.7.0/lib/netstandard1.1/System.Threading.Tasks.Dataflow.dll
  -r:/Users/jason/.nuget/packages/system.threading.tasks/4.3.0/ref/netstandard1.3/System.Threading.Tasks.dll
  -r:/Users/jason/.nuget/packages/system.threading.tasks.extensions/4.3.0/lib/netstandard1.0/System.Threading.Tasks.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.threading.tasks.parallel/4.3.0/ref/netstandard1.1/System.Threading.Tasks.Parallel.dll
  -r:/Users/jason/.nuget/packages/system.threading.thread/4.3.0/ref/netstandard1.3/System.Threading.Thread.dll
  -r:/Users/jason/.nuget/packages/system.threading.threadpool/4.3.0/ref/netstandard1.3/System.Threading.ThreadPool.dll
  -r:/Users/jason/.nuget/packages/system.threading.timer/4.3.0/ref/netstandard1.2/System.Threading.Timer.dll
  -r:/Users/jason/.nuget/packages/system.xml.readerwriter/4.3.0/ref/netstandard1.3/System.Xml.ReaderWriter.dll
  -r:/Users/jason/.nuget/packages/system.xml.xdocument/4.3.0/ref/netstandard1.3/System.Xml.XDocument.dll
  --target:exe
  --warn:4
  --warnaserror:76
  --fullpaths
  --flaterrors
  --highentropyva-
  --targetprofile:netcore
  --simpleresolution
  --nocopyfsharpcore
  /Users/jason/src/bug55626/Program.fs

CopyFilesToOutputDirectory:
  Copying file from "obj/Debug/netcoreapp1.1/bug55626.dll" to "bin/Debug/netcoreapp1.1/bug55626.dll".
  bug55626 -> /Users/jason/src/bug55626/bin/Debug/netcoreapp1.1/bug55626.dll
Done Building Project "/Users/jason/src/bug55626/bug55626.fsproj" (Build target(s)).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.42
✔ ~/src/bug55626
09:12 $ mono --version
Mono JIT compiler version 5.0.0.76 (2017-02/5da5fa2 Fri Apr 21 18:14:36 EDT 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           normal
        SIGSEGV:       altstack
        Notification:  kqueue
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          yes(3.6.0svn-mono-master/8b1520c)
        GC:            sgen (concurrent by default)
Comment 2 Enrico Sada 2017-04-27 08:40:12 UTC
@nosami i think is wrong.

i see in your comment

```
/Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/msbuild/15.0/bin/../../../fsharp/fsc.exe -o:obj/Debug/netcoreapp1.1/bug55626.dll
```

That's using the wrong fsc.

fsc should be from inside FSharp.Compiler.Tools package

from my local

```
CoreCompile:
  Tool /home/enrico/.nuget/packages/fsharp.compiler.tools/4.1.15/build/../tools/fsc.exe execution started with arguments:  -o:obj/Debug/netcoreapp1.1/c1.dll
```

Why in your environment is overriding FscToolPath and FscToolExe? is not needed, will work ootb using the fsc inside the package, so can be updated and build deps are deterministic (doesnt depend on installation).

Ihmo mono can bundle an fsc, but is not the best idea to use the bundled fsc in fsproj
Comment 3 Jason Imison 2017-04-27 08:49:00 UTC
I think the idea is that we can build netcore apps without having any .NET Core SDK installed.

I do see your point though.
Comment 4 Enrico Sada 2017-04-27 08:54:38 UTC
@nosami you can already :D

the fsc used from msbuild is the `tools/fsc.exe`, so is net40, run as `mono fsc.exe`

So you can already build netstandard1.6/netcoreapp1.0 with fsc.exe, no need for .net core sdk (the cli) installed, it's never gonna execute `dotnet fsc`

fsc now is like msbuild, same program, built for different runtimes.

The FSharp.Compiler.Tools default the FscToolPath/FscToolExe based on the msbuild host runtime.
Comment 5 Jason Imison 2017-04-27 08:56:49 UTC
OK. Will get this changed
Comment 6 Jason Imison 2017-04-27 09:07:33 UTC
✔ ~/src/bug55626
10:05 $ msbuild /t:Build
Microsoft (R) Build Engine version 15.2.0.0 (xplat-2017-02/20b9fb5 Fri Apr 21 18:29:38 EDT 2017)
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 4/27/2017 10:05:54 AM.
Project "/Users/jason/src/bug55626/bug55626.fsproj" on node 1 (Build target(s)).
PrepareForBuild:
  Creating directory "bin/Debug/netcoreapp1.1/".
  Creating directory "obj/Debug/netcoreapp1.1/".
CoreCompile:
  /Users/jason/.nuget/packages/fsharp.compiler.tools/4.1.15/build/../tools/fsc.exe -o:obj/Debug/netcoreapp1.1/bug55626.dll
  -g
  --debug:portable
  --noframework
  --define:DEBUG
  --define:NETCOREAPP1_1
  --optimize-
  -r:/Users/jason/.nuget/packages/fsharp.core/4.1.12/lib/netstandard1.6/FSharp.Core.dll
  -r:/Users/jason/.nuget/packages/microsoft.csharp/4.3.0/ref/netstandard1.0/Microsoft.CSharp.dll
  -r:/Users/jason/.nuget/packages/microsoft.visualbasic/10.1.0/ref/netstandard1.1/Microsoft.VisualBasic.dll
  -r:/Users/jason/.nuget/packages/microsoft.win32.primitives/4.3.0/ref/netstandard1.3/Microsoft.Win32.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.appcontext/4.3.0/ref/netstandard1.6/System.AppContext.dll
  -r:/Users/jason/.nuget/packages/system.buffers/4.3.0/lib/netstandard1.1/System.Buffers.dll
  -r:/Users/jason/.nuget/packages/system.collections.concurrent/4.3.0/ref/netstandard1.3/System.Collections.Concurrent.dll
  -r:/Users/jason/.nuget/packages/system.collections/4.3.0/ref/netstandard1.3/System.Collections.dll
  -r:/Users/jason/.nuget/packages/system.collections.immutable/1.3.0/lib/netstandard1.0/System.Collections.Immutable.dll
  -r:/Users/jason/.nuget/packages/system.componentmodel.annotations/4.3.0/ref/netstandard1.4/System.ComponentModel.Annotations.dll
  -r:/Users/jason/.nuget/packages/system.componentmodel/4.3.0/ref/netstandard1.0/System.ComponentModel.dll
  -r:/Users/jason/.nuget/packages/system.console/4.3.0/ref/netstandard1.3/System.Console.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.debug/4.3.0/ref/netstandard1.3/System.Diagnostics.Debug.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.diagnosticsource/4.3.0/lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.process/4.3.0/ref/netstandard1.4/System.Diagnostics.Process.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.tools/4.3.0/ref/netstandard1.0/System.Diagnostics.Tools.dll
  -r:/Users/jason/.nuget/packages/system.diagnostics.tracing/4.3.0/ref/netstandard1.5/System.Diagnostics.Tracing.dll
  -r:/Users/jason/.nuget/packages/system.dynamic.runtime/4.3.0/ref/netstandard1.3/System.Dynamic.Runtime.dll
  -r:/Users/jason/.nuget/packages/system.globalization.calendars/4.3.0/ref/netstandard1.3/System.Globalization.Calendars.dll
  -r:/Users/jason/.nuget/packages/system.globalization/4.3.0/ref/netstandard1.3/System.Globalization.dll
  -r:/Users/jason/.nuget/packages/system.globalization.extensions/4.3.0/ref/netstandard1.3/System.Globalization.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.io.compression/4.3.0/ref/netstandard1.3/System.IO.Compression.dll
  -r:/Users/jason/.nuget/packages/system.io.compression.zipfile/4.3.0/ref/netstandard1.3/System.IO.Compression.ZipFile.dll
  -r:/Users/jason/.nuget/packages/system.io/4.3.0/ref/netstandard1.5/System.IO.dll
  -r:/Users/jason/.nuget/packages/system.io.filesystem/4.3.0/ref/netstandard1.3/System.IO.FileSystem.dll
  -r:/Users/jason/.nuget/packages/system.io.filesystem.primitives/4.3.0/ref/netstandard1.3/System.IO.FileSystem.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.io.filesystem.watcher/4.3.0/ref/netstandard1.3/System.IO.FileSystem.Watcher.dll
  -r:/Users/jason/.nuget/packages/system.io.memorymappedfiles/4.3.0/ref/netstandard1.3/System.IO.MemoryMappedFiles.dll
  -r:/Users/jason/.nuget/packages/system.io.unmanagedmemorystream/4.3.0/ref/netstandard1.3/System.IO.UnmanagedMemoryStream.dll
  -r:/Users/jason/.nuget/packages/system.linq/4.3.0/ref/netstandard1.6/System.Linq.dll
  -r:/Users/jason/.nuget/packages/system.linq.expressions/4.3.0/ref/netstandard1.6/System.Linq.Expressions.dll
  -r:/Users/jason/.nuget/packages/system.linq.parallel/4.3.0/ref/netstandard1.1/System.Linq.Parallel.dll
  -r:/Users/jason/.nuget/packages/system.linq.queryable/4.3.0/ref/netstandard1.0/System.Linq.Queryable.dll
  -r:/Users/jason/.nuget/packages/system.net.http/4.3.0/ref/netstandard1.3/System.Net.Http.dll
  -r:/Users/jason/.nuget/packages/system.net.nameresolution/4.3.0/ref/netstandard1.3/System.Net.NameResolution.dll
  -r:/Users/jason/.nuget/packages/system.net.primitives/4.3.0/ref/netstandard1.3/System.Net.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.net.requests/4.3.0/ref/netstandard1.3/System.Net.Requests.dll
  -r:/Users/jason/.nuget/packages/system.net.security/4.3.0/ref/netstandard1.3/System.Net.Security.dll
  -r:/Users/jason/.nuget/packages/system.net.sockets/4.3.0/ref/netstandard1.3/System.Net.Sockets.dll
  -r:/Users/jason/.nuget/packages/system.net.webheadercollection/4.3.0/ref/netstandard1.3/System.Net.WebHeaderCollection.dll
  -r:/Users/jason/.nuget/packages/system.numerics.vectors/4.3.0/ref/netstandard1.0/System.Numerics.Vectors.dll
  -r:/Users/jason/.nuget/packages/system.objectmodel/4.3.0/ref/netstandard1.3/System.ObjectModel.dll
  -r:/Users/jason/.nuget/packages/system.reflection.dispatchproxy/4.3.0/ref/netstandard1.3/System.Reflection.DispatchProxy.dll
  -r:/Users/jason/.nuget/packages/system.reflection/4.3.0/ref/netstandard1.5/System.Reflection.dll
  -r:/Users/jason/.nuget/packages/system.reflection.extensions/4.3.0/ref/netstandard1.0/System.Reflection.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.reflection.metadata/1.4.1/lib/netstandard1.1/System.Reflection.Metadata.dll
  -r:/Users/jason/.nuget/packages/system.reflection.primitives/4.3.0/ref/netstandard1.0/System.Reflection.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.reflection.typeextensions/4.3.0/ref/netstandard1.5/System.Reflection.TypeExtensions.dll
  -r:/Users/jason/.nuget/packages/system.resources.reader/4.3.0/lib/netstandard1.0/System.Resources.Reader.dll
  -r:/Users/jason/.nuget/packages/system.resources.resourcemanager/4.3.0/ref/netstandard1.0/System.Resources.ResourceManager.dll
  -r:/Users/jason/.nuget/packages/system.runtime/4.3.0/ref/netstandard1.5/System.Runtime.dll
  -r:/Users/jason/.nuget/packages/system.runtime.extensions/4.3.0/ref/netstandard1.5/System.Runtime.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.runtime.handles/4.3.0/ref/netstandard1.3/System.Runtime.Handles.dll
  -r:/Users/jason/.nuget/packages/system.runtime.interopservices/4.3.0/ref/netcoreapp1.1/System.Runtime.InteropServices.dll
  -r:/Users/jason/.nuget/packages/system.runtime.interopservices.runtimeinformation/4.3.0/ref/netstandard1.1/System.Runtime.InteropServices.RuntimeInformation.dll
  -r:/Users/jason/.nuget/packages/system.runtime.numerics/4.3.0/ref/netstandard1.1/System.Runtime.Numerics.dll
  -r:/Users/jason/.nuget/packages/system.security.cryptography.algorithms/4.3.0/ref/netstandard1.6/System.Security.Cryptography.Algorithms.dll
  -r:/Users/jason/.nuget/packages/system.security.cryptography.encoding/4.3.0/ref/netstandard1.3/System.Security.Cryptography.Encoding.dll
  -r:/Users/jason/.nuget/packages/system.security.cryptography.primitives/4.3.0/ref/netstandard1.3/System.Security.Cryptography.Primitives.dll
  -r:/Users/jason/.nuget/packages/system.security.cryptography.x509certificates/4.3.0/ref/netstandard1.4/System.Security.Cryptography.X509Certificates.dll
  -r:/Users/jason/.nuget/packages/system.security.principal/4.3.0/ref/netstandard1.0/System.Security.Principal.dll
  -r:/Users/jason/.nuget/packages/system.text.encoding/4.3.0/ref/netstandard1.3/System.Text.Encoding.dll
  -r:/Users/jason/.nuget/packages/system.text.encoding.extensions/4.3.0/ref/netstandard1.3/System.Text.Encoding.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.text.regularexpressions/4.3.0/ref/netcoreapp1.1/System.Text.RegularExpressions.dll
  -r:/Users/jason/.nuget/packages/system.threading/4.3.0/ref/netstandard1.3/System.Threading.dll
  -r:/Users/jason/.nuget/packages/system.threading.tasks.dataflow/4.7.0/lib/netstandard1.1/System.Threading.Tasks.Dataflow.dll
  -r:/Users/jason/.nuget/packages/system.threading.tasks/4.3.0/ref/netstandard1.3/System.Threading.Tasks.dll
  -r:/Users/jason/.nuget/packages/system.threading.tasks.extensions/4.3.0/lib/netstandard1.0/System.Threading.Tasks.Extensions.dll
  -r:/Users/jason/.nuget/packages/system.threading.tasks.parallel/4.3.0/ref/netstandard1.1/System.Threading.Tasks.Parallel.dll
  -r:/Users/jason/.nuget/packages/system.threading.thread/4.3.0/ref/netstandard1.3/System.Threading.Thread.dll
  -r:/Users/jason/.nuget/packages/system.threading.threadpool/4.3.0/ref/netstandard1.3/System.Threading.ThreadPool.dll
  -r:/Users/jason/.nuget/packages/system.threading.timer/4.3.0/ref/netstandard1.2/System.Threading.Timer.dll
  -r:/Users/jason/.nuget/packages/system.xml.readerwriter/4.3.0/ref/netstandard1.3/System.Xml.ReaderWriter.dll
  -r:/Users/jason/.nuget/packages/system.xml.xdocument/4.3.0/ref/netstandard1.3/System.Xml.XDocument.dll
  --target:exe
  --warn:4
  --warnaserror:76
  --fullpaths
  --flaterrors
  --highentropyva-
  --targetprofile:netcore
  --simpleresolution
  --nocopyfsharpcore
  /Users/jason/src/bug55626/Program.fs

CopyFilesToOutputDirectory:
  Copying file from "obj/Debug/netcoreapp1.1/bug55626.dll" to "bin/Debug/netcoreapp1.1/bug55626.dll".
  bug55626 -> /Users/jason/src/bug55626/bin/Debug/netcoreapp1.1/bug55626.dll
Done Building Project "/Users/jason/src/bug55626/bug55626.fsproj" (Build target(s)).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:04.69
Comment 7 Enrico Sada 2017-04-27 09:15:32 UTC
```
CoreCompile:
  /Users/jason/.nuget/packages/fsharp.compiler.tools/4.1.15/build/../tools/fsc.exe -o:obj/Debug/netcoreapp1.1/bug55626.dll
```

Awesome!

yesterday i also tried changing to `<TargetFramework>net45<TargetFramework>`

and after Restore and Build

```
  Tool /home/enrico/.nuget/packages/fsharp.compiler.tools/4.1.15/build/../tools/fsc.exe execution started with arguments:  -o:obj/Debug/net45/c3.exe
```

will use the right 4.5 facade

Running built with `mono ./obj/Debug/net45/c3.exe` works correctly too
Comment 8 Jason Imison 2017-04-28 08:27:13 UTC
https://github.com/mono/msbuild/pull/13
Comment 9 Jason Imison 2017-04-28 11:49:00 UTC
Fixed in Mono 5.0.0.89
Comment 10 Roshan Mankani 2017-05-09 09:49:12 UTC
Hello @Enrico Sada,
Can you please provide proper steps or description with expected condition, for verify this bug