gpt4 book ai didi

c# - 使用 System.Windows.Forms 损坏的 Mono C# 代码

转载 作者:太空狗 更新时间:2023-10-29 18:30:38 29 4
gpt4 key购买 nike

几个月前,我开始使用 Mono 编译一个相对简单的 C# 应用程序。

我今天尝试恢复这方面的工作,尽管有一个可执行文件证明它之前编译得很好,但它现在提示 System.Windows.Forms

C:\Program Files\Mono-2.0.1\bin>mcs ../projects/test_1/test.cs
../projects/test_1/test.cs(2,14): error CS0234: The type or namespace name 'Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings

我发现了一个论坛帖子,有人有同样的错误,推荐这个:

mcs Program.cs -r:System.Windows.Forms.dll -r:System.Drawing.dll -v2

但是,-v2 参数不起作用,没有它,只会出现一系列其他命名空间错误(ToolStripButton 和类似的)。

我已经下载了最新的 Mono 2.2,但仍然会产生同样的错误。

我该如何解决这个问题?

最佳答案

gmcs Program.cs -r:System.Windows.Forms.dll -r:System.Drawing.dll

gmcs 使用 .NET 2.0 配置文件。

关于c# - 使用 System.Windows.Forms 损坏的 Mono C# 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/551096/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com