Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dll 未能为类型库创建包装程序集_Dll_F# - Fatal编程技术网

Dll 未能为类型库创建包装程序集

Dll 未能为类型库创建包装程序集,dll,f#,Dll,F#,我参考: open FSharp.Charting open System.Drawing 在我的项目中,我添加了引用System.Drawing.dll,这是唯一一个名为“.dll”的引用 我收到以下错误消息: 警告6未能为类型库创建包装程序集 “System.Drawing.dll”。已从导出类型库“System_Drawing” CLR程序集,无法作为CLR程序集重新导入 发生了什么?除非获得再现行为所需的全部详细信息,否则很难说您的设置有什么具体错误。这将更容易提供一个最低限度的工作样

我参考:

open FSharp.Charting
open System.Drawing
在我的项目中,我添加了引用
System.Drawing.dll
,这是唯一一个名为“.dll”的引用

我收到以下错误消息:

警告6未能为类型库创建包装程序集 “System.Drawing.dll”。已从导出类型库“System_Drawing” CLR程序集,无法作为CLR程序集重新导入


发生了什么?

除非获得再现行为所需的全部详细信息,否则很难说您的设置有什么具体错误。这将更容易提供一个最低限度的工作样本,让你得到滚动。有关使用WPF的
FSharp.Charting
的说明,请遵循。由于似乎没有给出WinForms建议,这里是最新库(v0.87)和.NET4.5的一个简单片段。您可以定义一个
F#Console应用程序
项目,并添加对
System.Drawing.dll
System.Windows.Forms.dll
的引用;假设
FSharp.Charting.dll
已被
NuGet
引用:

open System
open FSharp.Charting
open FSharp.Charting.ChartTypes
open System.Drawing
open System.Windows.Forms

[<STAThread; EntryPoint>]
let main args =
    let myChart = [for x in 0.0 .. 0.1 .. 6.0 -> sin x + cos (2.0 * x)]
                    |> Chart.Line

    let form = new Form(Visible = true, TopMost = true, Width = 700, Height = 500)
    form.Controls.Add(new ChartControl(myChart, Dock=DockStyle.Fill))
    do Application.Run(form) |> ignore
    0
开放系统
打开FSharp.Charting
打开FSharp.Charting.ChartTypes
开放系统.绘图
打开System.Windows.Forms
[]
让主参数=
让myChart=[对于0.0..0.1..6.0中的x->sinx+cos(2.0*x)]
|>图表线
让表单=新表单(可见=真,最顶端=真,宽度=700,高度=500)
添加(新的ChartControl(myChart,Dock=DockStyle.Fill))
do Application.Run(form)|>ignore
0

除非获得再现行为所需的全部详细信息,否则很难说您的设置到底出了什么问题。这将更容易提供一个最低限度的工作样本,让你得到滚动。有关使用WPF的
FSharp.Charting
的说明,请遵循。由于似乎没有给出WinForms建议,这里是最新库(v0.87)和.NET4.5的一个简单片段。您可以定义一个
F#Console应用程序
项目,并添加对
System.Drawing.dll
System.Windows.Forms.dll
的引用;假设
FSharp.Charting.dll
已被
NuGet
引用:

open System
open FSharp.Charting
open FSharp.Charting.ChartTypes
open System.Drawing
open System.Windows.Forms

[<STAThread; EntryPoint>]
let main args =
    let myChart = [for x in 0.0 .. 0.1 .. 6.0 -> sin x + cos (2.0 * x)]
                    |> Chart.Line

    let form = new Form(Visible = true, TopMost = true, Width = 700, Height = 500)
    form.Controls.Add(new ChartControl(myChart, Dock=DockStyle.Fill))
    do Application.Run(form) |> ignore
    0
开放系统
打开FSharp.Charting
打开FSharp.Charting.ChartTypes
开放系统.绘图
打开System.Windows.Forms
[]
让主参数=
让myChart=[对于0.0..0.1..6.0中的x->sinx+cos(2.0*x)]
|>图表线
让表单=新表单(可见=真,最顶端=真,宽度=700,高度=500)
添加(新的ChartControl(myChart,Dock=DockStyle.Fill))
do Application.Run(form)|>ignore
0

您想要实现什么:只需从
fsx
脚本中使用
FSharp.Charting
,或者构建WinForms或WPF应用程序?这个因素定义了所需项目和所需引用的类型。我正在构建一个控制台应用程序,稍后我计划重新组织工作并将代码重组为库。Tnx.您试图实现什么:只需从
fsx
脚本中使用
FSharp.Charting
,或者构建WinForms或WPF应用程序?这个因素定义了所需项目和所需引用的类型。我正在构建一个控制台应用程序,稍后我计划重新组织工作并将代码重组为库。谢谢你。旁注:我在尝试运行您的示例时犯的另一个错误是,我通过com而不是.net()引用了Windows.Forms。非常感谢。旁注:我在尝试运行您的示例时犯的另一个错误是,我通过com而不是.net()引用了Windows.Forms