更新单声道后,F#build无法找到两个包

时间:2017-06-08 01:07:50

标签: f# f#-fake paket ionide

我在Linux下有一个现有的F#/ Mono / paket / fake项目,用于正确编译。

我使用apt-get更新了mono,现在我的项目无法编译。

它找不到两个引用的包:MathNet.Numerics和Newtonsoft.Json。

这是我在构建项目时所得到的:

Primary reference "MathNet.Numerics".
/usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(1980,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "MathNet.Numerics". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/home/bleakcabal/Documents/projects/genesis/genesis/genesis/genesis.fsproj]
          For SearchPath "{TargetFrameworkDirectory}".
          Considered "/usr/lib/mono/xbuild-frameworks/.NETFramework/v4.5/MathNet.Numerics.winmd", but it didn't exist.
          Considered "/usr/lib/mono/xbuild-frameworks/.NETFramework/v4.5/MathNet.Numerics.dll", but it didn't exist.
          Considered "/usr/lib/mono/xbuild-frameworks/.NETFramework/v4.5/MathNet.Numerics.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/MathNet.Numerics.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/MathNet.Numerics.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/MathNet.Numerics.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/Facades/MathNet.Numerics.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/Facades/MathNet.Numerics.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/Facades/MathNet.Numerics.exe", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/Facades/MathNet.Numerics.winmd", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/Facades/MathNet.Numerics.dll", but it didn't exist.
          Considered "/usr/lib/mono/4.5-api/Facades/MathNet.Numerics.exe", but it didn't exist.
          For SearchPath "{GAC}".
          Considered "MathNet.Numerics", which was not found in the GAC.
          For SearchPath "{RawFileName}".
          Considered treating "MathNet.Numerics" as a file name, but it didn't exist.
          For SearchPath "/home/bleakcabal/Documents/projects/genesis/build/".
          Considered "/home/bleakcabal/Documents/projects/genesis/build/MathNet.Numerics.winmd", but it didn't exist.
          Considered "/home/bleakcabal/Documents/projects/genesis/build/MathNet.Numerics.dll", but it didn't exist.
          Considered "/home/bleakcabal/Documents/projects/genesis/build/MathNet.Numerics.exe", but it didn't exist.

该文件位于我项目中的packages文件夹中(我使用带有paket和假的VS代码使用Ionide-fsharp创建)但该文件夹没有出现在错误消息中。

我收到了与Newtonsoft.Json完全相同的消息。

这是我的paket.dependencies文件:

source https://www.nuget.org/api/v2

nuget FAKE
nuget FSharp.Core
nuget MathNet.Numerics
nuget Newtonsoft.Json

我的paket.lock文件太长而无法发布,但以下是相关部分:

MathNet.Numerics (3.19)
      TaskParallelLibrary (>= 1.0.2856) - framework: net35

Newtonsoft.Json (10.0.2)
      Microsoft.CSharp (>= 4.3) - framework: netstandard10, >= netstandard13
      NETStandard.Library (>= 1.6.1) - framework: netstandard10, >= netstandard13
      System.ComponentModel.TypeConverter (>= 4.3) - framework: netstandard10, >= netstandard13
      System.Runtime.Serialization.Formatters (>= 4.3) - framework: >= netstandard13
      System.Runtime.Serialization.Primitives (>= 4.3) - framework: netstandard10, >= netstandard13
      System.Xml.XmlDocument (>= 4.3) - framework: >= netstandard13

以下是我引用这些软件包的多个.fsproj文件之一的摘录:

...
<Reference Include="MathNet.Numerics" />
<Reference Include="Newtonsoft.Json" />
...
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v3.5'">
  <ItemGroup>
    <Reference Include="MathNet.Numerics">
      <HintPath>..\..\packages\MathNet.Numerics\lib\net35\MathNet.Numerics.dll</HintPath>
      <Private>True</Private>
      <Paket>True</Paket>
    </Reference>
  </ItemGroup>
</When>
<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' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
  <ItemGroup>
    <Reference Include="MathNet.Numerics">
      <HintPath>..\..\packages\MathNet.Numerics\lib\net40\MathNet.Numerics.dll</HintPath>
      <Private>True</Private>
      <Paket>True</Paket>
    </Reference>
  </ItemGroup>
</When>

如果我mono --version我得到以下内容:

Mono JIT compiler version 5.0.1.1 (2017-02/5077205 Thu May 25 09:16:53 UTC 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

我尝试使用以下命令,但无济于事:.paket/paket.exe restore.paket/paket.exe install.paket/paket.exe outdated

2 个答案:

答案 0 :(得分:1)

要运行paket,您需要运行

$ mono paket.exe install

如果您仍然遇到缺少程序集或不稳定引用的问题,请尝试

$ apt-get install mono-dev

$ apt-get install mono-complete

有关Mono安装的更多信息,请查看http://www.mono-project.com/download/#download-lin

答案 1 :(得分:1)

我最后做了paket.exe update --redirects像@TaylorFraley推荐修改了一些文件。

然后使用paket ionide插件我从我的解决方案中删除了两个包。

然后我在解决方案中搜索了关于这两个软件包的剩余内容(我的.fsproj中包含两个Reference Include),然后我手动将其删除。

我再次使用paket Ionide插件重新安装了软件包,一切正常。

因此,解决方案是删除所有内容并再次添加。不知道为什么paket更新不起作用。