这里,我的标准是孤立问题:
open Microsoft.FSharp.Metadata
[<EntryPoint>]
let main args =
let core = FSharpAssembly.FromFile @"C:Program FilesFSharp-2.0.0.0\binFSharp.Core.dll"
let core2 = FSharpAssembly.FSharpLibrary
let core3 = System.AppDomain.CurrentDomain.GetAssemblies()
|> Seq.find (fun a -> a.FullName.Contains "Core")
|> FSharpAssembly.FromAssembly
core.Entities |> Seq.iter (printfn "%A")
0
所有三个<条码>条码>都应给我同样的FSharpAssembly。 相反,所有3个国家都提出了Sharp的例外。 核心不是“F#”组(细节如下,改为可读)。 另有两点:
- Using the
core3
method, I get the same error for the test F# assembly itself - I don t get the error at FSI after doing
#r "@C:Program Files...FSharp.Powerpack.Metadata.dll"
.
任何想法? I m利用视觉演播室2008年,F# 2.0和F# Power Pack 2.0.0.0(2010年5月20日)发布在一部古老的XP RV上,我认为它已经更新到SP3。
(我今天上午用Power Pack 1.9.9错,因此我升至2.0.0.0。) 我认为,如果1.9.9.9.不承认F# s2.0.0.0s的组件,那么,在电容器2.0.0.0中也许可以装饰。
Unhandled Exception: System.TypeInitializationException:
The type initializer for Microsoft.FSharp.Metadata.AssemblyLoader threw an
exception.
---> System.TypeInitializationException: The type initializer for
<StartupCode$FSharp-PowerPack-Metadata>.$Metadata threw an exception.
---> System.ArgumentException: could not produce an FSharpAssembly
object for the assembly FSharp.Core because
this is not an F# assembly
Parameter name: name
at Microsoft.FSharp.Metadata.AssemblyLoader.Add(String name,Assembly assembly)
at <StartupCode$FSharp-PowerPack-Metadata>.$Metadata..cctor()
--- End of inner exception stack trace ---
at Microsoft.FSharp.Metadata.AssemblyLoader..cctor()
--- End of inner exception stack trace ---
at Microsoft.FSharp.Metadata.AssemblyLoader.Get(Assembly assembly)
at Microsoft.FSharp.Metadata.FSharpAssembly.FromAssembly(Assembly assembly)
at Program.main(String[] args) in
C:Documents an...FSMetadataTestProgram.fs:line 11
Press any key to continue . . .