mono 下运行 VB.NET 编写的 WinForm 程序

操作系统环境 UOS 20

安装 Mono 可以参考 dotnet 在 UOS 国产系统上安装 Mono 开发工具的方法

要点如下

nano /etc/apt/sources.list

增加一行 Debian 镜像地址

deb https://mirrors.ustc.edu.cn/debian buster main contrib non-free

接着开始安装 mono-devel 工具

sudo apt-get install mono-devel

安装完成之后,尝试在终端输入 mono --version 命令,如果能看到 mono 输出,那么证明安装成功. 要补充的是 mono 默认安装不支持 VB.NET,无法运行 VB.NET 开发的程序,报错信息显示为"Could not load file or assembly 'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A' or one of its dependencies",需要安装 mono-vbnc 组件库

sudo apt-get install mono-vbnc


安装完成之后,请注释掉 /etc/apt/sources.list 文件添加的 debian 源,不然也许会帮你更新 Kernal 组件,然后你重启之后就不能打开了