fsharp / zarchive-vim-fsharp

F# bindings for vim
MIT License
143 stars 34 forks source link

Referencing external libraries in .fs files #39

Closed schmohlio closed 8 years ago

schmohlio commented 8 years ago

Hi all - Possibly quick question? Thanks in advance.

I currently have a project in which I have .dll files within my bin/Debug directory. Any ./*.fs files in my project that reference libraries within these dlls (they are defined in my paket config) are unrecognized by vim-fsharp. These libraries are recognized when opening the file in xamarin.

Is there a way to setup a project so that external libraries are within the vim-fsharp namespace? Thanks in advance.

rneatherway commented 8 years ago

Are you on Windows? If so, which versions of VS2015 are installed?

rneatherway commented 8 years ago

That should be, which versions of VS?

schmohlio commented 8 years ago

Thanks for response, @rneatherway . Projects were created in various versions of VS. But I am using vim on linux and OSX machines. Ideally I'm looking for some way to be agnostic of IDE versions....

I'm able to build and run the project with mono. I'm very close to having a dev env on different operating system.

rneatherway commented 8 years ago

I see, this should be working fine on unix. Can you confirm the version of FsAutoComplete you have (look in the Vim plugin directory and run mono fsautocomplete.exe --version). Once you've found it, please getting some log output for the project file with mono <path to>/FSharp.Compiler.Service.ProjectCrackerTool.exe --text <path to>/MyProject.fsproj true.

schmohlio commented 8 years ago

Thanks again @rneatherway .

I ran mono fsautocomplete.exe --version w/in ~/.vim/plugged/vim-fsharp/ftplugin/bin and received version 0.27.0.

I'm a little confused on finding that ProjectCrackerTool executable. Is that within my mono dist?

rneatherway commented 8 years ago

It should be in ~/.vim/plugged/vim-fsharp/ftplugin/bin as well, is it in there?

schmohlio commented 8 years ago

ahh thank you. it seems there is some sort of issue... apologies I'm a little new to mono Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring. Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring. Build started. Project started. Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring. Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring. Target named 'ResolveReferences' not found in the project. Project started. Build finished. ";}

schmohlio commented 8 years ago

I also get the following on another project. We use FAKE to build. Guessing some of this is heavily tied to VS params? The required attribute "Project" in Import is empty at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program+FSharpProjectFileInfo..ctor (System.String fsprojFileName, Microsoft.FSharp.Core.FSharpOption1 properties, Microsoft.FSharp.Core.FSharpOption1 enableLogging) in <filename unknown>:line 0 at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.getOptions@358 (Boolean enableLogging, Microsoft.FSharp.Collections.FSharpList1 properties, System.String file) in :line 0 at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.getOptions (System.String file, Boolean enableLogging, Microsoft.FSharp.Collections.FSharpList1 properties) in <filename unknown>:line 0 at Microsoft.FSharp.Compiler.SourceCodeServices.ProjectCrackerTool.Program.main (System.String[] argv) in <filename unknown>:line 0";}

rneatherway commented 8 years ago

Can you post the project file? What version of mono do you have installed?

schmohlio commented 8 years ago

Sure, I masked some libraries. really appreciate it. I'm using mono Mono JIT compiler version 4.2.0 (Stable 4.2.0.179/a224653

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{9052590D-046B-4C3C-9DC8-237B4613438F}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>sample</RootNamespace>
    <AssemblyName>sample</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <TargetFSharpCoreVersion>4.3.1.0</TargetFSharpCoreVersion>
    <Name>sample</Name>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <Optimize>false</Optimize>
    <Tailcalls>false</Tailcalls>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <WarningLevel>3</WarningLevel>
    <DocumentationFile>bin\Debug\sample.XML</DocumentationFile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <Tailcalls>true</Tailcalls>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <WarningLevel>3</WarningLevel>
    <DocumentationFile>bin\Release\sample.XML</DocumentationFile>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="mscorlib" />
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Numerics" />
    <Reference Include="FSharp.Core">
      <Private>True</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Common.fs" />
    <Compile Include="database.fs" />
    <None Include="Script.fsx" />
  </ItemGroup>
  <PropertyGroup>
    <MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
  </PropertyGroup>
  <Choose>
    <When Condition="'$(VisualStudioVersion)' == '11.0'">
      <PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')">
        <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
        <FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
      </PropertyGroup>
    </Otherwise>
  </Choose>
  <Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v3.0' Or $(TargetFrameworkVersion) == 'v3.5' Or $(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="Crc32C.NET">
          <HintPath>..\packages\Crc32C.NET\lib\net20\Crc32C.NET.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="database.ClientAPI">
          <HintPath>..\packages\database.Client\lib\net40\Bus.ClientAPI.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v1.0'">
      <ItemGroup>
        <Reference Include="log4net">
          <HintPath>..\packages\log4net\lib\1.0\log4net.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v1.1'">
      <ItemGroup>
        <Reference Include="log4net">
          <HintPath>..\packages\log4net\lib\1.1\log4net.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v3.0' Or $(TargetFrameworkVersion) == 'v3.5' Or $(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="log4net">
          <HintPath>..\packages\log4net\lib\2.0\log4net.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="Library">
          <HintPath>..\packages\Library\lib\net45\Library.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="Library.database">
          <HintPath>..\packages\Library.database\lib\net45\Library.Bus.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="Library.Json">
          <HintPath>..\packages\Library.Json\lib\net45\Library.Json.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="Bus.Client">
          <HintPath>..\packages\Library.Bus\lib\net45\Kafka.Client.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="Library.Bus">
          <HintPath>..\packages\Library.Bus\lib\net45\Library.Kafka.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
        <Reference Include="Spring.Threading">
          <HintPath>..\packages\Library.Bus\lib\net45\Spring.Threading.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="Metrics">
          <HintPath>..\packages\Metrics.NET\lib\net45\Metrics.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v3.5'">
      <ItemGroup>
        <Reference Include="Newtonsoft.Json">
          <HintPath>..\packages\Newtonsoft.Json\lib\net35\Newtonsoft.Json.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v3.0')">
      <ItemGroup>
        <Reference Include="Newtonsoft.Json">
          <HintPath>..\packages\Newtonsoft.Json\lib\net20\Newtonsoft.Json.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0')">
      <ItemGroup>
        <Reference Include="Newtonsoft.Json">
          <HintPath>..\packages\Newtonsoft.Json\lib\net40\Newtonsoft.Json.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="Newtonsoft.Json">
          <HintPath>..\packages\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile78') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile259')">
      <ItemGroup>
        <Reference Include="Newtonsoft.Json">
          <HintPath>..\packages\Newtonsoft.Json\lib\portable-net45+wp80+win8+wpa81+dnxcore50\Newtonsoft.Json.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkProfile) == 'Profile5') Or ($(TargetFrameworkProfile) == 'Profile6') Or ($(TargetFrameworkProfile) == 'Profile14') Or ($(TargetFrameworkProfile) == 'Profile19') Or ($(TargetFrameworkProfile) == 'Profile24') Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile37') Or ($(TargetFrameworkProfile) == 'Profile42') Or ($(TargetFrameworkProfile) == 'Profile47') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkProfile) == 'Profile92') Or ($(TargetFrameworkProfile) == 'Profile102') Or ($(TargetFrameworkProfile) == 'Profile136') Or ($(TargetFrameworkProfile) == 'Profile147') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile158') Or ($(TargetFrameworkProfile) == 'Profile225') Or ($(TargetFrameworkProfile) == 'Profile240') Or ($(TargetFrameworkProfile) == 'Profile255') Or ($(TargetFrameworkProfile) == 'Profile328') Or ($(TargetFrameworkProfile) == 'Profile336') Or ($(TargetFrameworkProfile) == 'Profile344')">
      <ItemGroup>
        <Reference Include="Newtonsoft.Json">
          <HintPath>..\packages\Newtonsoft.Json\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v3.5'">
      <ItemGroup>
        <Reference Include="NLog">
          <HintPath>..\packages\NLog\lib\net35\NLog.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0')">
      <ItemGroup>
        <Reference Include="NLog">
          <HintPath>..\packages\NLog\lib\net40\NLog.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="NLog">
          <HintPath>..\packages\NLog\lib\net45\NLog.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v4.0'">
      <ItemGroup>
        <Reference Include="NLog">
          <HintPath>..\packages\NLog\lib\sl4\NLog.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0'">
      <ItemGroup>
        <Reference Include="NLog">
          <HintPath>..\packages\NLog\lib\sl5\NLog.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v3.0' Or $(TargetFrameworkVersion) == 'v3.5' Or $(TargetFrameworkVersion) == 'v4.0')">
      <ItemGroup>
        <Reference Include="Snappy.NET">
          <HintPath>..\packages\Snappy.NET\lib\net20\Snappy.NET.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="Snappy.NET">
          <HintPath>..\packages\Snappy.NET\lib\net45\Snappy.NET.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
      <ItemGroup>
        <Reference Include="ZooKeeperNet">
          <HintPath>..\packages\ZooKeeper.Net\lib\net40\ZooKeeperNet.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>
</Project>
rneatherway commented 8 years ago

Which error did you get from this project? When I test it locally it seems OK, although obviously it can't find the references.

I think the problem is something to do with this line:

  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

Perhaps MSBuildToolsVersion isn't set or something. What was the rest of the log output that you posted the end of before?

schmohlio commented 8 years ago

that was the extent of the logs.

I actually think I realize the problem. Our repos build with FAKE. Generally, the .fsproj files do not include build instructions/references.

schmohlio commented 8 years ago

Is there a way to reference a bin directory of dlls to add references?

rneatherway commented 8 years ago

In the first case the closing brace indicates the end of the data structure containing the log ouput, so the whole thing wasn't there. In the second, looks like it raised an exception, which isn't great.

When people build with FAKE they normally still use MSBuild for the compilation, so the fsproj files should have a complete list of references. If you run xbuild project.fsproj does it succeed?

schmohlio commented 8 years ago

Using FAKE to build (http://fsharp.github.io/FAKE/fsc.html). I added <Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Outputs="$(TargetPath)"/> to my .fsproj and now my project builds with xbuilds successfully.

Here is the log from the mono cmd:

{ProjectFile = "MyProject.fsproj";
 Options =
  [|"--simpleresolution"; "--noframework";
    "--doc:my-xml.XML";
    "--fullpaths"; "--flaterrors"; "--target:library"; "--define:DEBUG";
    "--define:TRACE"; "--debug+"; "--optimize-"; "--tailcalls-";
    "--platform:anycpu";
    "/Users/mschmohl/development/vagrant-docker-base/base-image/Flash-Bolt/Flash.EventStoreToKafka/Common.fs";
    "/Users/mschmohl/development/vagrant-docker-base/base-image/Flash-Bolt/Flash.EventStoreToKafka/EventStore.fs"|];
 ReferencedProjectOptions = [||];
 LogOutput =
  "Loading default tasks for ToolsVersion: 4.0 from /usr/local/Cellar/mono/4.2.0.179/lib/mono/4.5/Microsoft.Common.tasks
Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring.
Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring.
Build started.
Project started.
Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring.
Extension path '/Library/Frameworks/Mono.framework/External/xbuild' not found, ignoring.
Target named 'ResolveReferences' not found in the project.
Project started.
Build finished.
";}```
schmohlio commented 8 years ago

It looks like some libraries require .Net 4.5, and their references aren't being matched in the .fsproj file. It is strange that the project builds, but the references aren't matched in .fsproj, i.e.

<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">

I'm guessing i can remove the choose in fsproj

rneatherway commented 8 years ago

I see, you are using the Fsc task in FAKE to build directly without MSBuild.

Thanks for the log, it seems like there is some fundamental problem like it cannot find the FSharp targets file. Have you installed mono both from Xamarin and homebrew? What is which xbuild?

If you build it with xbuild /v:diagnostic and put that log in a gist I might be able to help.

schmohlio commented 8 years ago

@rneatherway thanks again for all your help. I may have install mono from both, so I will investigate that. FYI - which xbuild returns /usr/local/bin/xbuild which possible looks different than whats in my diagnostic, here: https://gist.github.com/schmohlio/3132c03a95cb63926893

rneatherway commented 8 years ago

I added to my .fsproj and now my project builds with xbuilds successfully.

You should never need to do this, so that is worrying. The Build target comes from <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> at the top of your project, so it can't find $(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props, depending on what the values of those variables are at the time. In your gist they are:

MSBuildExtensionsPath = /usr/local/Cellar/mono/4.2.0.179/lib/mono/xbuild
MSBuildToolsVersion = 4.0

so I assume that /usr/local/Cellar/mono/4.2.0.179/lib/mono/xbuild/4.0/Microsoft.Common.props exists? If not there is something odd about your machine. What is ls -l /usr/local/bin/xbuild?

schmohlio commented 8 years ago

Re: .fsproj -- that is because i built the project with atom+ fake most likely.

Maybe we can just close this issue and I will start fresh on the mac os, as ls -l yields lrwxr-xr-x 1 mschmohl admin 35 Jan 21 15:00 /usr/local/bin/xbuild -> ../Cellar/mono/4.2.0.179/bin/xbuild

Nevertheless, will vim-fsharp support Fsc builds? Is that potentially a fresh issue?

rneatherway commented 8 years ago

Nevertheless, will vim-fsharp support Fsc builds? Is that potentially a fresh issue?

All the non-VS editors use FsAutoComplete/FSharp.Compiler.Service as a backend, and this relies on a valid .fsproj file to determine the references. Using an Fsc build through FAKE, there isn't an obvious route to get the dependency information into the compiler interface so this is unlikely to change any time soon, at least not without a new contributor fleshing out how it might work.

schmohlio commented 8 years ago

ok thanks for all of your help @rneatherway. I think I might be able to figure something out with Fsc.