我在 Linux 下有一个现有的 F#/Mono/paket/fake 项目,用于正确编译。
我使用 apt-get 更新了单声道,现在我的项目无法编译。
它找不到两个引用的包: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
我的项目中的一个文件夹中(我使用 Ionide-fsharp 和使用 paket 和 fake 的 VS 代码创建了该文件夹),但该文件夹未出现在错误消息中。
我收到了与 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
.