Mono 找不到字体或颜色
Mono can't find Font or Color
我正在尝试使用 mono 编译 C#,但 mono 返回以下错误:
CS0246: the type or namespace name 'Font' could not be found ...
CS0246: the type or namespace name 'Color' could not be found ...
CS0246: the type or namespace name 'Color' could not be found ...
我的导入语句如下所示:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Font;
using System.Drawing.Imaging;
using System.IO;
有什么想法吗?单声道是否支持字体 Class 和颜色结构?我似乎找不到任何关于官方支持和不支持的文档,如果你能指出正确的方向,那就太好了。
一般来说,当从命令行使用单声道时,你会做这样的事情:
$ mcs program.cs
但是,您必须包括文件顶部引用的程序集 program.cs
,例如 System.Drawing。为此,您必须使用 reference
开关:
$ mcs /reference:System.Drawing.dll program.cs
...直到您的程序编译。
希望对您有所帮助。
我正在尝试使用 mono 编译 C#,但 mono 返回以下错误:
CS0246: the type or namespace name 'Font' could not be found ...
CS0246: the type or namespace name 'Color' could not be found ...
CS0246: the type or namespace name 'Color' could not be found ...
我的导入语句如下所示:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Font;
using System.Drawing.Imaging;
using System.IO;
有什么想法吗?单声道是否支持字体 Class 和颜色结构?我似乎找不到任何关于官方支持和不支持的文档,如果你能指出正确的方向,那就太好了。
一般来说,当从命令行使用单声道时,你会做这样的事情:
$ mcs program.cs
但是,您必须包括文件顶部引用的程序集 program.cs
,例如 System.Drawing。为此,您必须使用 reference
开关:
$ mcs /reference:System.Drawing.dll program.cs
...直到您的程序编译。
希望对您有所帮助。