Skip to content

Instantly share code, notes, and snippets.

@cloudRoutine
Last active October 18, 2015 20:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudRoutine/75fcf0651c740e07aa21 to your computer and use it in GitHub Desktop.
Save cloudRoutine/75fcf0651c740e07aa21 to your computer and use it in GitHub Desktop.
Build the Visual F# Compiler and Tools for .Net CoreCLR ( On Windows )

Make things easy for yourself and start by running posh as admin

If you already have dnvm installed remember to run update-self if you haven't recently

Clone and checkout the coreclr branch of Kevin Ransom's Fork of the Visual F# Compiler and Tools

Installing DNVM

You need DNVM as a starting point. DNVM enables you to acquire a (or multiple) .NET Execution Environment (DNX). DNVM is simply a script, which doesn't depend on .NET. You can install it via a PowerShell command. You can find alternate DNVM install instructions at the ASP.NET Home repo.

λ» @powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"

You must close your command-prompt and start a new one in order for the user-wide environment variables to take effect.

You can see the currently installed DNX versions with dnvm list, which will display an empty set of installed runtimes.

λ» dnvm list

Installing a .NET Core DNX

It's easy to install the latest .NET Core-based DNX, using the dnvm install command. The -u (or -Unstable) parameter installs latest unstable version.

λ» dnvm install -r coreclr latest -u

This will install the 32-bit version of .NET Core. If you want the 64-bit version, you can specify processor architecture:

λ» dnvm install -r coreclr -arch x64 latest -u

You can see the currently installed DNX versions with dnvm list (your display may vary as new versions of the DNX are published):

λ» dnvm list
Active Version           Runtime Architecture Location                       Alias
------ -------           ------- ------------ --------                       -----
       1.0.0-beta8-15736 coreclr x64          C:\Users\Jared\.dnx\runtimes
       1.0.0-beta8-15736 coreclr x86          C:\Users\Jared\.dnx\runtimes

You can choose which of these DNXs you want to use with dnvm use, with similar arguments.

λ» dnvm use -r coreclr -arch x64 1.0.0-beta8-15736

Adding C:\Users\Jared\.dnx\runtimes\dnx-coreclr-win-x64.1.0.0-beta8-15736\bin to process PATH

λ» dnvm list

Active Version           Runtime Architecture Location                       Alias
------ -------           ------- ------------ --------                       -----
  *    1.0.0-beta8-15736 coreclr x64          C:\Users\Jared\.dnx\runtimes
       1.0.0-beta8-15736 coreclr x86          C:\Users\Jared\.dnx\runtimes

Build FSharp for .NET Core

While in the directory you've cloned the visualfsharp repo to ( e.g. C:\Users\Jared\Github\fs-coreclr\visualfsharp ) fetch the DotNet buildtools using:

λ» .nuget\NuGet.exe restore packages.config -PackagesDirectory packages

If you have not added MSBuild to your PATH you add the dir

C:\Program Files (x86)\MSBuild\14.0\Bin

To build and pull in the corefx assemblies for nuget build coreclr using this command:

// For Debug
λ» msbuild src\fsharp\FSharp.Core\FSharp.Core.fsproj /p:TargetFramework=coreclr /t:Rebuild /p:RestorePackages=true 

// For Release
λ» msbuild src\fsharp\FSharp.Core\FSharp.Core.fsproj /p:TargetFramework=coreclr /t:Rebuild /p:RestorePackages=true  /p:Configuration=Release

otherwise build fsharp.core like this:

// For Debug
λ» msbuild src\fsharp\FSharp.Core\FSharp.Core.fsproj /p:TargetFramework=coreclr

// For Release
λ» msbuild src\fsharp\FSharp.Core\FSharp.Core.fsproj /p:TargetFramework=coreclr /p:Configuration=Release

then build the compiler with the command:

// For Debug
λ» msbuild src/fsharp-compiler-build.proj /p:TargetFramework=coreclr /t:Rebuild /p:RestorePackages=true

// For Release
λ» msbuild src/fsharp-compiler-build.proj /p:TargetFramework=coreclr /t:Rebuild /p:RestorePackages=true /p:Configuration=Release
@zpodlovics
Copy link

Partially possible to reproduce it on Linux (Ubuntu 14.04 x86_64 with Mono official apt/deb packages):

  1. Change coreclr source to aspvnext
diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config
index 09cec30..df5ca11 100644
--- a/.nuget/NuGet.Config
+++ b/.nuget/NuGet.Config
@@ -5,7 +5,7 @@
   </solution>
   <packageSources>
     <clear/>
-    <add key="myget.org dotnet-coreclr" value="https://www.myget.org/F/dotnet-coreclr/" />
+    <add key="myget.org dotnet-coreclr" value="https://www.myget.org/F/aspnetvnext/" />
     <add key="myget.org dotnet-corefx" value="https://www.myget.org/F/dotnet-corefx/" />
     <add key="myget.org dotnet-corefxtestdata" value="https://www.myget.org/F/dotnet-corefxtestdata/" />
     <add key="myget.org dotnet-buildtools" value="https://www.myget.org/F/dotnet-buildtools/" />
  1. Change dnx-mono dnx-coreclr package names and versions to linux
diff --git a/packages.config b/packages.config
index 5aa1219..4199dec 100644
--- a/packages.config
+++ b/packages.config
@@ -1,9 +1,9 @@
 <U+FEFF><?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="dnx-coreclr-win-x86" version="1.0.0-beta6-12032" />
-  <package id="dnx-mono" version="1.0.0-beta5-12077" />
+  <package id="dnx-coreclr-linux-x64" version="1.0.0-beta8-15736" />
+  <package id="dnx-mono" version="1.0.0-beta8-15736" />
   <package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00085" />
   <package id="NUnit" version="2.6.4" targetFramework="net40" />
   <package id="NUnit.Runners" version="2.6.4" />
   <package id="FSharp.Data" version="2.2.5" />
-</packages>
\ No newline at end of file
+</packages>
  1. Install MSBuild to your local system (ugly hack)

3.1) Eg.:

mkdir -p /usr/local/stow/msbuild/bin

3.2) Add the content to /usr/local/stow/msbuild/bin/msbuild

#!/bin/sh

packageid="Microsoft.Build.Mono.Debug"
version="14.1.0.0-prerelease" # update as needed

mono .nuget/NuGet.exe install $packageid -Version \
    $version -Source "https://www.myget.org/F/dotnet-buildtools/"

# run MSBuild
mono $packageid.$version/lib/MSBuild.exe $@
  1. Restore packages with NuGet (Note:the download could fail, try to retry several times)
mono .nuget/NuGet.exe restore packages.config -ConfigFile .nuget/NuGet.Config -PackagesDirectory packages
  1. The missing pieces.

5.1) Bootstrap compiler?

export PATH=/usr/local/stow/msbuild/bin:$PATH

msbuild src/fsharp-proto-build.proj /t:Rebuild /p:RestorePackages=true  /p:Configuration=Release
Package "Microsoft.Build.Mono.Debug.14.1.0-prerelease" is already installed.
Microsoft (R) Build Engine version 14.1.0.0
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/29/2015 5:23:37 PM.
Project "/tmp/visualfsharp/src/fsharp-proto-build.proj" on node 1 (Rebuild target(s)).
Project "/tmp/visualfsharp/src/fsharp-proto-build.proj" (1) is building "/tmp/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj" (2) on node 1 (Rebuild target(s)).
/tmp/visualfsharp/src/FSharpSource.targets(751,3): error MSB4024: The imported project file "/usr/lib/mono/Microsoft SDKs/F#/3.1/Framework/v4.0/Microsoft.FSharp.Targets" could not be loaded. Could not find file "/usr/lib/mono/Microsoft SDKs/F". [/tmp/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj]
Done Building Project "/tmp/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj" (Rebuild target(s)) -- FAILED.
Project "/tmp/visualfsharp/src/fsharp-proto-build.proj" (1) is building "/tmp/visualfsharp/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj" (3) on node 1 (Rebuild target(s)).
/tmp/visualfsharp/src/FSharpSource.targets(751,3): error MSB4024: The imported project file "/usr/lib/mono/Microsoft SDKs/F#/3.1/Framework/v4.0/Microsoft.FSharp.Targets" could not be loaded. Could not find file "/usr/lib/mono/Microsoft SDKs/F". [/tmp/visualfsharp/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj]
Done Building Project "/tmp/visualfsharp/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj" (Rebuild target(s)) -- FAILED.
Project "/tmp/visualfsharp/src/fsharp-proto-build.proj" (1) is building "/tmp/visualfsharp/src/fsharp/Fsc-proto/Fsc-proto.fsproj" (4) on node 1 (Rebuild target(s)).
/tmp/visualfsharp/src/FSharpSource.targets(751,3): error MSB4024: The imported project file "/usr/lib/mono/Microsoft SDKs/F#/3.1/Framework/v4.0/Microsoft.FSharp.Targets" could not be loaded. Could not find file "/usr/lib/mono/Microsoft SDKs/F". [/tmp/visualfsharp/src/fsharp/Fsc-proto/Fsc-proto.fsproj]
Done Building Project "/tmp/visualfsharp/src/fsharp/Fsc-proto/Fsc-proto.fsproj" (Rebuild target(s)) -- FAILED.
Done Building Project "/tmp/visualfsharp/src/fsharp-proto-build.proj" (Rebuild target(s)) -- FAILED.

Build FAILED.

"/tmp/visualfsharp/src/fsharp-proto-build.proj" (Rebuild target) (1) ->
"/tmp/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj" (Rebuild target) (2) ->
  /tmp/visualfsharp/src/FSharpSource.targets(751,3): error MSB4024: The imported project file "/usr/lib/mono/Microsoft SDKs/F#/3.1/Framework/v4.0/Microsoft.FSharp.Targets" could not be loaded. Could not find file "/usr/lib/mono/Microsoft SDKs/F". [/tmp/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj]


"/tmp/visualfsharp/src/fsharp-proto-build.proj" (Rebuild target) (1) ->
"/tmp/visualfsharp/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj" (Rebuild target) (3) ->
  /tmp/visualfsharp/src/FSharpSource.targets(751,3): error MSB4024: The imported project file "/usr/lib/mono/Microsoft SDKs/F#/3.1/Framework/v4.0/Microsoft.FSharp.Targets" could not be loaded. Could not find file "/usr/lib/mono/Microsoft SDKs/F". [/tmp/visualfsharp/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj]


"/tmp/visualfsharp/src/fsharp-proto-build.proj" (Rebuild target) (1) ->
"/tmp/visualfsharp/src/fsharp/Fsc-proto/Fsc-proto.fsproj" (Rebuild target) (4) ->
  /tmp/visualfsharp/src/FSharpSource.targets(751,3): error MSB4024: The imported project file "/usr/lib/mono/Microsoft SDKs/F#/3.1/Framework/v4.0/Microsoft.FSharp.Targets" could not be loaded. Could not find file "/usr/lib/mono/Microsoft SDKs/F". [/tmp/visualfsharp/src/fsharp/Fsc-proto/Fsc-proto.fsproj]

    0 Warning(s)
    3 Error(s)

Time Elapsed 00:00:01.14

The file exists:

file "/usr/lib/mono/Microsoft SDKs/F#/3.1/Framework/v4.0/Microsoft.FSharp.Targets"
/usr/lib/mono/Microsoft SDKs/F#/3.1/Framework/v4.0/Microsoft.FSharp.Targets: ASCII text

But MSBuild cannot find it:

Could not find file "/usr/lib/mono/Microsoft SDKs/F". 

5.2) Missing bootstrap compiler

msbuild src/fsharp/FSharp.Core/FSharp.Core.fsproj /p:TargetFramework=coreclr /t:Rebuild /p:RestorePackages=true  /p:Configuration=Release
Package "Microsoft.Build.Mono.Debug.14.1.0-prerelease" is already installed.
Microsoft (R) Build Engine version 14.1.0.0
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/29/2015 5:17:06 PM.
Project "/tmp/visualfsharp/src/fsharp/FSharp.Core/FSharp.Core.fsproj" on node 1 (Rebuild target(s)).
/tmp/visualfsharp/src/FSharpSource.targets(751,3): error MSB4019: The imported project "/tmp/visualfsharp/Proto/net40/bin/Microsoft.Portable.FSharp-proto.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [/tmp/visualfsharp/src/fsharp/FSharp.Core/FSharp.Core.fsproj]
Done Building Project "/tmp/visualfsharp/src/fsharp/FSharp.Core/FSharp.Core.fsproj" (Rebuild target(s)) -- FAILED.

Build FAILED.

"/tmp/visualfsharp/src/fsharp/FSharp.Core/FSharp.Core.fsproj" (Rebuild target) (1) ->
  /tmp/visualfsharp/src/FSharpSource.targets(751,3): error MSB4019: The imported project "/tmp/visualfsharp/Proto/net40/bin/Microsoft.Portable.FSharp-proto.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [/tmp/visualfsharp/src/fsharp/FSharp.Core/FSharp.Core.fsproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.21

@ctaggart
Copy link

I've attempted to build @KevinRansom's coreclr branch this weekend on Debian. It is actually the docker image from asp.net with coreclr 1.0.0-beta7 already installed in /opt/dnx.

docker run --rm -ti -p 5004:5004 microsoft/aspnet:1.0.0-beta7-coreclr

I was trying to build proto first, but it can't resolve ISymWrapper. I'm curious how to proceed.

$ msbuild src/fsharp-proto-build.proj /t:Rebuild /p:Configuration=Release
$ grep -r ISymWrapper
Binary file lkg/FSharp-4.0.30319.1/bin/FSharp.Compiler.dll matches
Binary file packages/dnx-coreclr-win-x86.1.0.0-beta7/bin/mscorlib.dll matches
src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj:    <Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
src/fsharp/FSharp.LanguageService.Compiler/FSharp.LanguageService.Compiler.fsproj:    <Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
src/fsharp/FSharp.Compiler/FSharp.Compiler.fsproj:    <Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
$ msbuild src/fsharp-proto-build.proj /t:Rebuild /p:Configuration=Release
Microsoft (R) Build Engine version 14.1.0.0
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 10/11/2015 22:20:10.
Project "/opt/visualfsharp/src/fsharp-proto-build.proj" on node 1 (Rebuild target(s)).
Project "/opt/visualfsharp/src/fsharp-proto-build.proj" (1) is building "/opt/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj" (2) on node 1 (Rebuild target(s)).
CoreClean:
  Deleting file "/opt/visualfsharp/src/fsharp/FSharp.Build-proto/obj/Release/net40/FSBuild.fs".
  Deleting file "/opt/visualfsharp/src/fsharp/FSharp.Build-proto/obj/Release/net40/FSBuild.resx".
  Deleting file "/opt/visualfsharp/src/fsharp/FSharp.Build-proto/obj/Release/net40/FSharp.Build-proto.fsprojResolveAssemblyReference.cache".
  Deleting file "/opt/visualfsharp/src/fsharp/FSharp.Build-proto/obj/Release/net40/FSBuild.resources".
  Deleting file "/opt/visualfsharp/src/fsharp/FSharp.Build-proto/obj/Release/net40/FSharp.Build-proto.fsproj.GenerateResource.Cache".
CallFsSrGen:
  Tool ../../../lkg/FSharp-4.0.30319.1/bin/fssrgen.exe execution started with arguments:  /opt/visualfsharp/src/fsharp/FSharp.Build/FSBuild.txt  obj/Release/net40/FSBuild.fs  obj/Release/net40/FSBuild.resx 
ResolveAssemblyReferences:
  Primary reference "../../../lkg/FSharp-4.0.30319.1/bin/FSharp.Core.dll".
/root/.dnx/packages/Microsoft.Build.Mono.Debug/14.1.0-prerelease/lib/Microsoft.Common.CurrentVersion.targets(1814,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Directory '/usr/lib/mono/gac/../../../lkg/FSharp-4.0.30319.1/bin' not found. [/opt/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj]
CoreResGen:
  /usr/lib/mono/4.5/resgen.exe -useSourcePath -r:/usr/lib/mono/4.5/Microsoft.Build.dll -r:/usr/lib/mono/4.5/Microsoft.Build.Engine.dll -r:/usr/lib/mono/4.5/Microsoft.Build.Framework.dll -r:/usr/lib/mono/4.5/Microsoft.Build.Tasks.v4.0.dll -r:/usr/lib/mono/4.5/Microsoft.Build.Utilities.v4.0.dll -r:/usr/lib/mono/4.5/mscorlib.dll -r:/usr/lib/mono/4.5/System.Core.dll -r:/usr/lib/mono/4.5/System.dll -r:/usr/lib/mono/4.5/System.Numerics.dll -compile obj/Release/net40/FSBuild.resx,obj/Release/net40/FSBuild.resources
  Processing resource file "obj/Release/net40/FSBuild.resx" into "obj/Release/net40/FSBuild.resources".
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
  Tool ../../../lkg/FSharp-4.0.30319.1/bin/fsc.exe execution started with arguments: -o:obj/Release/net40/FSharp.Build-proto.dll -g --debug:pdbonly --noframework --define:STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY --define:BUILDING_WITH_LKG --define:TRACE --define:OPEN_BUILD --define:FSHARP_CORE_4_5 --define:FX_ATLEAST_45 --define:FX_ATLEAST_40 --define:FX_ATLEAST_35 --define:BE_SECURITY_TRANSPARENT --define:QUERIES_IN_FSLIB --define:PUT_TYPE_PROVIDERS_IN_FSCORE --define:FX_ATLEAST_LINQ --define:ENABLE_MONO_SUPPORT --define:FX_MSBUILDRESOLVER_RUNTIMELIKE --define:TYPE_PROVIDER_SECURITY --define:FX_LCIDFROMCODEPAGE --define:FX_RESX_RESOURCE_READER --define:FX_RESIDENT_COMPILER --doc:../../../Release/net40/bin/FSharp.Build-proto.xml --optimize+ --resource:obj/Release/net40/FSBuild.resources -r:/usr/lib/mono/4.5/Microsoft.Build.dll -r:/usr/lib/mono/4.5/Microsoft.Build.Engine.dll -r:/usr/lib/mono/4.5/Microsoft.Build.Framework.dll -r:/usr/lib/mono/4.5/Microsoft.Build.Tasks.v4.0.dll -r:/usr/lib/mono/4.5/Microsoft.Build.Utilities.v4.0.dll -r:/usr/lib/mono/4.5/mscorlib.dll -r:/usr/lib/mono/4.5/System.Core.dll -r:/usr/lib/mono/4.5/System.dll -r:/usr/lib/mono/4.5/System.Numerics.dll --target:library --nowarn:69,65,54,61,75 --warn:3 --warnaserror --warnaserror:76 --fullpaths --flaterrors  --times --version:4.4.0.9055 --keyfile:"../..\fsharp\test.snk" obj/Release/net40/FSBuild.fs /tmp/.NETFramework,Version=v4.5.AssemblyAttributes.fs ../../utils/CompilerLocationUtils.fs ../FSharp.Build/CreateFSharpManifestResourceName.fsi ../FSharp.Build/CreateFSharpManifestResourceName.fs ../FSharp.Build/Fsc.fsi ../FSharp.Build/Fsc.fs 
  Microsoft (R) F# 2.0 Compiler build 4.0.30319.1
  Copyright (c) Microsoft Corporation. All Rights Reserved.

FSC : error FS0243: Unrecognized option: '/tmp/.NETFramework,Version=v4.5.AssemblyAttributes.fs' [/opt/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj]
Done Building Project "/opt/visualfsharp/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj" (Rebuild target(s)) -- FAILED.
Project "/opt/visualfsharp/src/fsharp-proto-build.proj" (1) is building "/opt/visualfsharp/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj" (3) on node 1 (Rebuild target(s)).
CoreClean:
  Deleting file "/opt/visualfsharp/src/fsharp/FSharp.Compiler-proto/obj/Release/net40/FSComp.fs".
  Deleting file "/opt/visualfsharp/src/fsharp/FSharp.Compiler-proto/obj/Release/net40/FSComp.resx".
  Deleting file "/opt/visualfsharp/src/fsharp/FSharp.Compiler-proto/obj/Release/net40/FSharp.Compiler-proto.fsprojResolveAssemblyReference.cache".
CallFsSrGen:
  Tool ../../../lkg/FSharp-4.0.30319.1/bin/fssrgen.exe execution started with arguments:  /opt/visualfsharp/src/fsharp/FSComp.txt  obj/Release/net40/FSComp.fs  obj/Release/net40/FSComp.resx 
ResolveAssemblyReferences:
  Primary reference "../../../lkg/FSharp-4.0.30319.1/bin/FSharp.Core.dll".
/root/.dnx/packages/Microsoft.Build.Mono.Debug/14.1.0-prerelease/lib/Microsoft.Common.CurrentVersion.targets(1814,5): warning MSB3246: Resolved file has a bad image, no metadata, or is otherwise inaccessible. Directory '/usr/lib/mono/gac/../../../lkg/FSharp-4.0.30319.1/bin' not found. [/opt/visualfsharp/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj]
  Primary reference "ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
/root/.dnx/packages/Microsoft.Build.Mono.Debug/14.1.0-prerelease/lib/Microsoft.Common.CurrentVersion.targets(1814,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/opt/visualfsharp/src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj]
          For SearchPath "{TargetFrameworkDirectory}".
          Considered "/usr/lib/mono/4.5/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5/Facades/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5/Facades/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5/Facades/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5/Facades/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5/Facades/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5/Facades/ISymWrapper.exe", but it didn't exist.
          For SearchPath "{AssemblyFolders}".
          Considered "/usr/lib/mono/3.5/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/3.5/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/3.5/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/aot-cache/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/aot-cache/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/aot-cache/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/xbuild/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/xbuild/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/xbuild/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/xbuild-frameworks/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/xbuild-frameworks/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/xbuild-frameworks/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.0/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.0/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.0/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/2.0/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/2.0/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/2.0/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/mono-configuration-crypto/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/mono-configuration-crypto/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/mono-configuration-crypto/ISymWrapper.exe", but it didn't exist.
          Considered "/usr/lib/mono/gac/ISymWrapper.winmd", but it didn't exist.
          Considered "/usr/lib/mono/gac/ISymWrapper.dll", but it didn't exist.
          Considered "/usr/lib/mono/gac/ISymWrapper.exe", but it didn't exist.
          For SearchPath "{GAC}".
          Considered "ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", which was not found in the GAC.
          For SearchPath "{RawFileName}".
          Considered treating "ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" as a file name, but it didn't exist.
          For SearchPath "../../../Release/net40/bin/".
          Considered "../../../Release/net40/bin/ISymWrapper.winmd", but it didn't exist.
          Considered "../../../Release/net40/bin/ISymWrapper.dll", but it didn't exist.
          Considered "../../../Release/net40/bin/ISymWrapper.exe", but it didn't exist.

@ctaggart
Copy link

FSharp.targets

@zpodlovics I got past the error with the FSharp.targets file with:

ln -s /opt/visualfsharp/lkg/FSharp-4.0.30319.1/bin/Microsoft.FSharp.targets /opt/visualfsharp/lkg/FSharp-4.0.30319.1/bin/Microsoft.FSharp.Targets

fssrgen.exe

The proto build also wants to run fssrgen.exe so:

nano /opt/visualfsharp/lkg/FSharp-4.0.30319.1/bin/fssrgen.exe
#!/bin/sh
mono /opt/visualfsharp/lkg/FSharp-4.0.30319.1/bin/FsSrGen.exe $@
chmod u+x /opt/visualfsharp/lkg/FSharp-4.0.30319.1/bin/fssrgen.exe

msbuild

I currently have msbuild setup like so:

mkdir /opt/bin
nano /opt/bin/msbuild
#!/bin/sh
mono /root/.dnx/packages/Microsoft.Build.Mono.Debug/14.1.0-prerelease/lib/MSBuild.exe $@   
chmod u+x /opt/bin/msbuild
export PATH=/opt/bin:$PATH

installing Mono

http://www.mono-project.com/docs/getting-started/install/linux/

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
apt-get update
apt-get install -y mono-devel

If you end up having to troubleshoot missing libraries, then you toggle on/off some env vars.
http://www.mono-project.com/docs/advanced/runtime/logging-runtime-events/

export MONO_LOG_LEVEL="debug"
export MONO_LOG_MASK="asm,type"
unset MONO_LOG_LEVEL
unset MONO_LOG_MASK

@ctaggart
Copy link

I started a Dockerfile that we can use to troubleshoot.
https://hub.docker.com/r/ctaggart/visualfsharp/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment