【发布时间】:2012-08-28 17:44:25
【问题描述】:
我正在尝试将一个用 C# 编写的 .NET 应用程序移植到 linux 中。
使用 MoMa 工具进行的兼容性测试表明该应用程序是兼容的。
我使用 Visual Studio 2010 编译了代码,并将生成的 .exe 文件复制到我的 Ubuntu VM(运行 10.04 LTS)。
我已经安装了带有 badgerport 源的单声道(来自 http://badgerports.org/lucid.html)。我看到我在 /usr/lib/mono 目录中有 4.0 的库:
user@ubuntu:~$ ls -l /usr/lib/mono
total 52
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 2.0
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 3.5
drwxr-xr-x 3 root root 12288 2012-08-27 07:15 4.0
drwxr-xr-x 2 root root 4096 2012-08-27 07:14 compat-2.0
drwxr-xr-x 145 root root 12288 2012-08-27 07:15 gac
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 mono-configuration-crypto
drwxr-xr-x 2 root root 4096 2012-08-27 07:15 monodoc
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 xbuild
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 xbuild-frameworks
当我查看 mono 的手册页时,我在顶部看到 Mono 2.5。
mono -V 返回以下内容。
user@ubuntu:~$ mono -V
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1~dhx1~lucid1)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
这是我尝试运行应用程序时的输出。
user@ubuntu:~$ mono MyApplication.exe
Unhandled Exception: System.TypeLoadException: A type load exception has occurred.
at MyApplication.ConsoleRunner..ctor () [0x00000] in <filename unknown>:0
at MyApplication.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: A type load exception has occurred.
at MyApplication.ConsoleRunner..ctor () [0x00000] in <filename unknown>:0
at MyApplication.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
对正在发生的事情有什么见解,我可以做些什么来解决它?不幸的是,由于其他开发限制,我仅限于使用 Ubuntu 10.04。
【问题讨论】:
-
如果我是你,我会尝试在 Ubuntu 上构建单声道开发项目,并检查调试器出了什么问题..
-
您至少需要使用 Windows Mono 编译器来编译程序。至于否决票的原因,这表明您缺乏研究。
-
@IDontKnowPopePersonally - 谢谢,我认为这最初是一个单声道设置或配置问题,所以我没想到要调试它。我会试一试看看发生了什么。
-
@Ramhound - 不,我从来没有使用过单声道,所以我什至不知道从哪里开始。我正在尝试学习。你缺乏帮助。